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

Method test_still_running

Lib/test/test__interpreters.py:457–467  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

455 t.join()
456
457 def test_still_running(self):
458 main, = [id for id, *_ in _interpreters.list_all()]
459 interp = _interpreters.create()
460 with _running(interp):
461 self.assertTrue(_interpreters.is_running(interp),
462 msg=f"Interp {interp} should be running before destruction.")
463
464 with self.assertRaises(_interpreters.InterpreterError,
465 msg=f"Should not be able to destroy interp {interp} while it's still running."):
466 _interpreters.destroy(interp)
467 self.assertTrue(_interpreters.is_running(interp))
468
469
470class CommonTests(TestBase):

Callers

nothing calls this directly

Calls 6

assertTrueMethod · 0.80
_runningFunction · 0.70
createMethod · 0.45
is_runningMethod · 0.45
assertRaisesMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected