diff options
| author | Thomas Grainger <tagrain@gmail.com> | 2021-07-20 18:15:07 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-20 18:15:07 (GMT) |
| commit | 7f1c330da31c54e028dceaf3610877914c2a4497 (patch) | |
| tree | 300b1b0e55088dc48f76bc11a5f2799a66936115 /Lib/test/test_contextlib_async.py | |
| parent | 85fa3b6b7c11897732fedc443db0e4e8e380c8f8 (diff) | |
| download | cpython-7f1c330da31c54e028dceaf3610877914c2a4497.zip cpython-7f1c330da31c54e028dceaf3610877914c2a4497.tar.gz cpython-7f1c330da31c54e028dceaf3610877914c2a4497.tar.bz2 | |
bpo-44566: resolve differences between asynccontextmanager and contextmanager (#27024)
Diffstat (limited to 'Lib/test/test_contextlib_async.py')
| -rw-r--r-- | Lib/test/test_contextlib_async.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_contextlib_async.py b/Lib/test/test_contextlib_async.py index 7904abf..6a218f9 100644 --- a/Lib/test/test_contextlib_async.py +++ b/Lib/test/test_contextlib_async.py @@ -209,7 +209,18 @@ class AsyncContextManagerTestCase(unittest.TestCase): async def woohoo(): yield - for stop_exc in (StopIteration('spam'), StopAsyncIteration('ham')): + class StopIterationSubclass(StopIteration): + pass + + class StopAsyncIterationSubclass(StopAsyncIteration): + pass + + for stop_exc in ( + StopIteration('spam'), + StopAsyncIteration('ham'), + StopIterationSubclass('spam'), + StopAsyncIterationSubclass('spam') + ): with self.subTest(type=type(stop_exc)): try: async with woohoo(): |
