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

Class ExitCM

Lib/test/test_contextlib.py:748–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

746 self.assertIsNone(exc)
747 self.assertIsNone(exc_tb)
748 class ExitCM(object):
749 def __init__(self, check_exc):
750 self.check_exc = check_exc
751 def __enter__(self):
752 self.fail("Should not be called!")
753 def __exit__(self, *exc_details):
754 self.check_exc(*exc_details)
755 with self.exit_stack() as stack:
756 stack.push(_expect_ok)
757 self.assertIs(stack._exit_callbacks[-1][1], _expect_ok)

Callers 1

test_pushMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_pushMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…