MCPcopy Index your code
hub / github.com/python/cpython / test_explicit_close

Method test_explicit_close

Lib/test/test_asyncio/test_runners.py:345–355  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

343 self.assertEqual('done', runner.run(MyAwaitable()))
344
345 def test_explicit_close(self):
346 runner = asyncio.Runner()
347 loop = runner.get_loop()
348 runner.close()
349 with self.assertRaisesRegex(
350 RuntimeError,
351 "Runner is closed"
352 ):
353 runner.get_loop()
354
355 self.assertTrue(loop.is_closed())
356
357 def test_double_close(self):
358 runner = asyncio.Runner()

Callers

nothing calls this directly

Calls 5

get_loopMethod · 0.95
closeMethod · 0.95
assertRaisesRegexMethod · 0.80
assertTrueMethod · 0.80
is_closedMethod · 0.45

Tested by

no test coverage detected