diff options
Diffstat (limited to 'Lib/test/test_asyncio/test_pep492.py')
-rw-r--r-- | Lib/test/test_asyncio/test_pep492.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py index 8dd0c25e7c..289f7e59db 100644 --- a/Lib/test/test_asyncio/test_pep492.py +++ b/Lib/test/test_asyncio/test_pep492.py @@ -10,6 +10,21 @@ import asyncio from test.test_asyncio import utils as test_utils +# Test that asyncio.iscoroutine() uses collections.abc.Coroutine +class FakeCoro: + def send(self, value): + pass + + def throw(self, typ, val=None, tb=None): + pass + + def close(self): + pass + + def __await__(self): + yield + + class BaseTest(test_utils.TestCase): def setUp(self): @@ -99,13 +114,6 @@ class CoroutineTests(BaseTest): finally: f.close() # silence warning - # Test that asyncio.iscoroutine() uses collections.abc.Coroutine - class FakeCoro: - def send(self, value): pass - def throw(self, typ, val=None, tb=None): pass - def close(self): pass - def __await__(self): yield - self.assertTrue(asyncio.iscoroutine(FakeCoro())) def test_iscoroutinefunction(self): |