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

Method test_tracebacks

Lib/test/test_unittest/testmock/testpatch.py:1125–1136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1123
1124
1125 def test_tracebacks(self):
1126 @patch.object(Foo, 'f', object())
1127 def test():
1128 raise AssertionError
1129 try:
1130 test()
1131 except:
1132 err = sys.exc_info()
1133
1134 result = unittest.TextTestResult(None, None, 0)
1135 traceback = result._exc_info_to_string(err, self)
1136 self.assertIn('raise AssertionError', traceback)
1137
1138
1139 def test_new_callable_patch(self):

Callers

nothing calls this directly

Calls 3

_exc_info_to_stringMethod · 0.80
assertInMethod · 0.80
testFunction · 0.50

Tested by

no test coverage detected