We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4639600 commit d3f670dCopy full SHA for d3f670d
Lib/test/test_repl.py
@@ -409,6 +409,20 @@ def test_toplevel_contextvars_async(self):
409
expected = "toplevel contextvar test: ok"
410
self.assertIn(expected, output, expected)
411
412
+ def test_loop_was_closed(self):
413
+ user_input = dedent("""\
414
+ import atexit
415
+ atexit.register(\
416
+ lambda loop: print("loop closed:", loop.is_closed()),\
417
+ asyncio.get_running_loop(),\
418
+ )
419
+ """)
420
+ p = spawn_asyncio_repl()
421
+ p.stdin.write(user_input)
422
+ output = kill_python(p)
423
+ self.assertEqual(p.returncode, 0)
424
+ self.assertIn("loop closed: True", output)
425
+
426
427
if __name__ == "__main__":
428
unittest.main()
0 commit comments