diff options
| author | Ofey Chan <ofey206@gmail.com> | 2022-09-30 08:43:02 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-30 08:43:02 (GMT) |
| commit | 83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65 (patch) | |
| tree | 31d942b63699bc5e1848ffb6f85901fe8b93301c /Lib/test/test_coroutines.py | |
| parent | 9a11ed8e50492d327e4de0a8f3a473e788b14a6f (diff) | |
| download | cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.zip cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.gz cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.bz2 | |
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
Diffstat (limited to 'Lib/test/test_coroutines.py')
| -rw-r--r-- | Lib/test/test_coroutines.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 8fff2d4..9a2279d 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -709,9 +709,16 @@ class CoroutineTest(unittest.TestCase): aw = coro.__await__() next(aw) with self.assertRaises(ZeroDivisionError): - aw.throw(ZeroDivisionError, None, None) + aw.throw(ZeroDivisionError()) self.assertEqual(N, 102) + coro = foo() + aw = coro.__await__() + next(aw) + with self.assertRaises(ZeroDivisionError): + with self.assertWarns(DeprecationWarning): + aw.throw(ZeroDivisionError, ZeroDivisionError(), None) + def test_func_11(self): async def func(): pass coro = func() |
