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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
be53f123
Commit
be53f123
authored
Oct 18, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an explicit test for async-def functions with decorators.
Closes GH-1462.
parent
758aaad0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
tests/run/coroutines.py
tests/run/coroutines.py
+31
-1
No files found.
tests/run/coroutines.py
View file @
be53f123
# cython: language_level=3
# mode: run
# tag: pep492, pure3.5
# tag: pep492, pure3.5
, gh1462, async, await
async
def
test_coroutine_frame
(
awaitable
):
...
...
@@ -28,3 +28,33 @@ async def test_coroutine_frame(awaitable):
"""
b
=
await
awaitable
return
b
# gh1462: Using decorators on coroutines.
def
pass_through
(
func
):
return
func
@
pass_through
async
def
test_pass_through
():
"""
>>> t = test_pass_through()
>>> try: t.send(None)
... except StopIteration as ex:
... print(ex.args[0] if ex.args else None)
... else: print("NOT STOPPED!")
None
"""
@
pass_through
(
pass_through
)
async
def
test_pass_through_with_args
():
"""
>>> t = test_pass_through_with_args()
>>> try: t.send(None)
... except StopIteration as ex:
... print(ex.args[0] if ex.args else None)
... else: print("NOT STOPPED!")
None
"""
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