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

Method test_exception_is_None

Lib/test/test_traceback.py:568–589  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

566 self.assertEqual(output, ["Exception: projector\n"])
567
568 def test_exception_is_None(self):
569 NONE_EXC_STRING = 'NoneType: None\n'
570 excfile = StringIO()
571 traceback.print_exception(None, file=excfile)
572 self.assertEqual(excfile.getvalue(), NONE_EXC_STRING)
573
574 excfile = StringIO()
575 traceback.print_exception(None, None, None, file=excfile)
576 self.assertEqual(excfile.getvalue(), NONE_EXC_STRING)
577
578 excfile = StringIO()
579 traceback.print_exc(None, file=excfile)
580 self.assertEqual(excfile.getvalue(), NONE_EXC_STRING)
581
582 self.assertEqual(traceback.format_exc(None), NONE_EXC_STRING)
583 self.assertEqual(traceback.format_exception(None), [NONE_EXC_STRING])
584 self.assertEqual(
585 traceback.format_exception(None, None, None), [NONE_EXC_STRING])
586 self.assertEqual(
587 traceback.format_exception_only(None), [NONE_EXC_STRING])
588 self.assertEqual(
589 traceback.format_exception_only(None, None), [NONE_EXC_STRING])
590
591 def test_signatures(self):
592 self.assertEqual(

Callers

nothing calls this directly

Calls 6

getvalueMethod · 0.95
StringIOClass · 0.90
print_exceptionMethod · 0.80
print_excMethod · 0.80
format_exception_onlyMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected