MCPcopy Index your code
hub / github.com/RustPython/RustPython / do_test_smoke

Method do_test_smoke

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

Source from the content-addressed store, hash-verified

3622
3623class TestTracebackException(unittest.TestCase):
3624 def do_test_smoke(self, exc, expected_type_str):
3625 try:
3626 raise exc
3627 except Exception as e:
3628 exc_obj = e
3629 exc = traceback.TracebackException.from_exception(e)
3630 expected_stack = traceback.StackSummary.extract(
3631 traceback.walk_tb(e.__traceback__))
3632 self.assertEqual(None, exc.__cause__)
3633 self.assertEqual(None, exc.__context__)
3634 self.assertEqual(False, exc.__suppress_context__)
3635 self.assertEqual(expected_stack, exc.stack)
3636 with self.assertWarns(DeprecationWarning):
3637 self.assertEqual(type(exc_obj), exc.exc_type)
3638 self.assertEqual(expected_type_str, exc.exc_type_str)
3639 self.assertEqual(str(exc_obj), str(exc))
3640
3641 def test_smoke_builtin(self):
3642 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