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

Method do_test_smoke

Lib/test/test_traceback.py:3546–3561  ·  view source on GitHub ↗
(self, exc, expected_type_str)

Source from the content-addressed store, hash-verified

3544
3545class TestTracebackException(unittest.TestCase):
3546 def do_test_smoke(self, exc, expected_type_str):
3547 try:
3548 raise exc
3549 except Exception as e:
3550 exc_obj = e
3551 exc = traceback.TracebackException.from_exception(e)
3552 expected_stack = traceback.StackSummary.extract(
3553 traceback.walk_tb(e.__traceback__))
3554 self.assertEqual(None, exc.__cause__)
3555 self.assertEqual(None, exc.__context__)
3556 self.assertEqual(False, exc.__suppress_context__)
3557 self.assertEqual(expected_stack, exc.stack)
3558 with self.assertWarns(DeprecationWarning):
3559 self.assertEqual(type(exc_obj), exc.exc_type)
3560 self.assertEqual(expected_type_str, exc.exc_type_str)
3561 self.assertEqual(str(exc_obj), str(exc))
3562
3563 def test_smoke_builtin(self):
3564 self.do_test_smoke(ValueError(42), 'ValueError')

Callers 2

test_smoke_builtinMethod · 0.95

Calls 5

strFunction · 0.85
from_exceptionMethod · 0.80
assertWarnsMethod · 0.80
extractMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected