mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-99357: Close the event loop when it is no longer used in test_uncancel_structured_blocks (#99414)
This commit is contained in:
parent
dfc1b17a23
commit
99972dc745
1 changed files with 23 additions and 20 deletions
|
@ -635,6 +635,7 @@ class BaseTaskTests:
|
|||
await asyncio.sleep(0)
|
||||
return timed_out, structured_block_finished, outer_code_reached
|
||||
|
||||
try:
|
||||
# Test which timed out.
|
||||
t1 = self.new_task(loop, make_request_with_timeout(sleep=10.0, timeout=0.1))
|
||||
timed_out, structured_block_finished, outer_code_reached = (
|
||||
|
@ -656,6 +657,8 @@ class BaseTaskTests:
|
|||
self.assertTrue(structured_block_finished)
|
||||
self.assertTrue(outer_code_reached)
|
||||
self.assertEqual(t2.cancelling(), 0)
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
def test_cancel(self):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue