Kaydet (Commit) fdba8381 authored tarafından Yury Selivanov's avatar Yury Selivanov

Issue #24017: Unset asyncio event loop after test.

üst 08a7a4e5
......@@ -772,13 +772,15 @@ class CoroAsyncIOCompatTest(unittest.TestCase):
raise MyException
buffer.append('unreachable')
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
try:
loop.run_until_complete(f())
except MyException:
pass
finally:
loop.close()
asyncio.set_event_loop(None)
self.assertEqual(buffer, [1, 2, 'MyException'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment