summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_coroutines.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2021-12-08 16:05:00 (GMT)
committerGitHub <noreply@github.com>2021-12-08 16:05:00 (GMT)
commitd4363d214097b3fca8b7910c2e0e91c8b0873fb2 (patch)
treeaff0f7c8b09418b5c4451be8a58c6073d5ac13df /Lib/test/test_coroutines.py
parent69806b9516dbe092381f3ef884c7c64bb9b8414a (diff)
downloadcpython-d4363d214097b3fca8b7910c2e0e91c8b0873fb2.zip
cpython-d4363d214097b3fca8b7910c2e0e91c8b0873fb2.tar.gz
cpython-d4363d214097b3fca8b7910c2e0e91c8b0873fb2.tar.bz2
bpo-45813: Drop redundant assertion from frame.clear() (GH-29990)
* bpo-45813: Drop redundant assertion from frame.clear() * Move assertion to frame_dealloc()
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r--Lib/test/test_coroutines.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index fc8b8bc..3081853 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -2191,13 +2191,22 @@ class CoroutineTest(unittest.TestCase):
return 'end'
self.assertEqual(run_async(run_gen()), ([], 'end'))
- def test_bpo_45813(self):
+ def test_bpo_45813_1(self):
'This would crash the interpreter in 3.11a2'
async def f():
pass
- frame = f().cr_frame
+ with self.assertWarns(RuntimeWarning):
+ frame = f().cr_frame
frame.clear()
+ def test_bpo_45813_2(self):
+ 'This would crash the interpreter in 3.11a2'
+ async def f():
+ pass
+ gen = f()
+ with self.assertWarns(RuntimeWarning):
+ gen.cr_frame.clear()
+
class CoroAsyncIOCompatTest(unittest.TestCase):