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

Method shouldThrow

Lib/test/test_with.py:416–420  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

414 def testSingleResource(self):
415 cm = mock_contextmanager_generator()
416 def shouldThrow():
417 with cm as self.resource:
418 self.assertInWithManagerInvariants(cm)
419 self.assertInWithGeneratorInvariants(self.resource)
420 self.raiseTestException()
421 self.assertRaises(RuntimeError, shouldThrow)
422 self.assertAfterWithManagerInvariantsWithError(cm)
423 self.assertAfterWithGeneratorInvariantsWithError(self.resource)

Callers

nothing calls this directly

Calls 4

cmClass · 0.85
raiseTestExceptionMethod · 0.80

Tested by

no test coverage detected