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

Method test_body_exception_suppress

Lib/test/test_contextlib.py:1145–1153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1143 exc.__context__.__context__.__context__.__context__.__context__)
1144
1145 def test_body_exception_suppress(self):
1146 def suppress_exc(*exc_details):
1147 return True
1148 try:
1149 with self.exit_stack() as stack:
1150 stack.push(suppress_exc)
1151 1/0
1152 except IndexError as exc:
1153 self.fail("Expected no exception, got IndexError")
1154
1155 def test_exit_exception_chaining_suppress(self):
1156 with self.exit_stack() as stack:

Callers

nothing calls this directly

Calls 2

pushMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected