diff options
Diffstat (limited to 'Lib/test/test_asyncio/test_futures.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_futures.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py index 55fdff3..358b190 100644 --- a/Lib/test/test_asyncio/test_futures.py +++ b/Lib/test/test_asyncio/test_futures.py @@ -76,6 +76,10 @@ class FutureTests(test_utils.TestCase): f = asyncio.Future(loop=self.loop) self.assertRaises(asyncio.InvalidStateError, f.exception) + # StopIteration cannot be raised into a Future - CPython issue26221 + self.assertRaisesRegex(TypeError, "StopIteration .* cannot be raised", + f.set_exception, StopIteration) + f.set_exception(exc) self.assertFalse(f.cancelled()) self.assertTrue(f.done()) |
