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

Method test_close

Lib/test/test_asyncio/test_base_events.py:211–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

209 gen.send(None)
210
211 def test_close(self):
212 self.assertFalse(self.loop.is_closed())
213 self.loop.close()
214 self.assertTrue(self.loop.is_closed())
215
216 # it should be possible to call close() more than once
217 self.loop.close()
218 self.loop.close()
219
220 # operation blocked when the loop is closed
221 f = self.loop.create_future()
222 self.assertRaises(RuntimeError, self.loop.run_forever)
223 self.assertRaises(RuntimeError, self.loop.run_until_complete, f)
224
225 def test__add_callback_handle(self):
226 h = asyncio.Handle(lambda: False, (), self.loop, None)

Callers

nothing calls this directly

Calls 6

assertFalseMethod · 0.80
assertTrueMethod · 0.80
is_closedMethod · 0.45
closeMethod · 0.45
create_futureMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected