Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
aded55c6
Commit
aded55c6
authored
May 13, 2015
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
collections.abc: Test that if an object is a Coroutine it is also an Awaitable
parent
71f574f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Lib/test/test_collections.py
Lib/test/test_collections.py
+16
-0
No files found.
Lib/test/test_collections.py
View file @
aded55c6
...
...
@@ -495,6 +495,22 @@ class TestOneTrickPonyABCs(ABCTestCase):
self
.
assertIsInstance
(
c
,
Awaitable
)
c
.
close
()
# awoid RuntimeWarning that coro() was not awaited
class
CoroLike
:
def
send
(
self
,
value
):
pass
def
throw
(
self
,
typ
,
val
=
None
,
tb
=
None
):
pass
def
close
(
self
):
pass
Coroutine
.
register
(
CoroLike
)
try
:
self
.
assertTrue
(
isinstance
(
CoroLike
(),
Awaitable
))
self
.
assertTrue
(
issubclass
(
CoroLike
,
Awaitable
))
CoroLike
=
None
finally
:
support
.
gc_collect
()
# Kill CoroLike to clean-up ABCMeta cache
def
test_Coroutine
(
self
):
def
gen
():
yield
...
...
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