Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
32425ed8
Commit
32425ed8
authored
Aug 07, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make syntax tests actually use Cython (and not Python)
parent
58fc7970
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
tests/run/test_coroutines_pep492.pyx
tests/run/test_coroutines_pep492.pyx
+9
-6
No files found.
tests/run/test_coroutines_pep492.pyx
View file @
32425ed8
...
@@ -72,6 +72,10 @@ def exec(code_string, l, g):
...
@@ -72,6 +72,10 @@ def exec(code_string, l, g):
g
.
update
(
ns
)
g
.
update
(
ns
)
def
compile
(
code_string
,
module
,
level
):
exec
(
code_string
,
{},
{})
class
AsyncYieldFrom
(
object
):
class
AsyncYieldFrom
(
object
):
def
__init__
(
self
,
obj
):
def
__init__
(
self
,
obj
):
self
.
obj
=
obj
self
.
obj
=
obj
...
@@ -461,7 +465,7 @@ class AsyncBadSyntaxTest(unittest.TestCase):
...
@@ -461,7 +465,7 @@ class AsyncBadSyntaxTest(unittest.TestCase):
"""
]
"""
]
for
code
in
samples
:
for
code
in
samples
:
with
self
.
subTest
(
code
=
code
),
self
.
assertRaises
(
SyntaxError
):
with
self
.
subTest
(
code
=
code
),
self
.
assertRaises
Regex
(
Errors
.
CompileError
,
'.'
):
compile
(
code
,
"<test>"
,
"exec"
)
compile
(
code
,
"<test>"
,
"exec"
)
def
test_badsyntax_2
(
self
):
def
test_badsyntax_2
(
self
):
...
@@ -496,17 +500,16 @@ class AsyncBadSyntaxTest(unittest.TestCase):
...
@@ -496,17 +500,16 @@ class AsyncBadSyntaxTest(unittest.TestCase):
"""async = 1"""
,
"""async = 1"""
,
"""print(await=1)"""
# FIXME: cannot currently request Py3 syntax in cython.inline()
#"""print(await=1)"""
]
]
for
code
in
samples
:
for
code
in
samples
:
with
self
.
subTest
(
code
=
code
),
self
.
assertWarnsRegex
(
with
self
.
subTest
(
code
=
code
):
# , self.assertRaisesRegex(Errors.CompileError, '.'):
DeprecationWarning
,
"'await' will become reserved keywords"
):
compile
(
code
,
"<test>"
,
"exec"
)
compile
(
code
,
"<test>"
,
"exec"
)
def
test_badsyntax_3
(
self
):
def
test_badsyntax_3
(
self
):
with
self
.
assertRaises
(
DeprecationWarning
):
#
with self.assertRaises(DeprecationWarning):
with
warnings
.
catch_warnings
():
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
"error"
)
warnings
.
simplefilter
(
"error"
)
compile
(
"async = 1"
,
"<test>"
,
"exec"
)
compile
(
"async = 1"
,
"<test>"
,
"exec"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment