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

Method test_exception_is_None

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

Source from the content-addressed store, hash-verified

588 self.assertEqual(output, ["Exception: projector\n"])
589
590 def test_exception_is_None(self):
591 NONE_EXC_STRING = 'NoneType: None\n'
592 excfile = StringIO()
593 traceback.print_exception(None, file=excfile)
594 self.assertEqual(excfile.getvalue(), NONE_EXC_STRING)
595
596 excfile = StringIO()
597 traceback.print_exception(None, None, None, file=excfile)
598 self.assertEqual(excfile.getvalue(), NONE_EXC_STRING)
599
600 excfile = StringIO()
601 traceback.print_exc(None, file=excfile)
602 self.assertEqual(excfile.getvalue(), NONE_EXC_STRING)
603
604 self.assertEqual(traceback.format_exc(None), NONE_EXC_STRING)
605 self.assertEqual(traceback.format_exception(None), [NONE_EXC_STRING])
606 self.assertEqual(
607 traceback.format_exception(None, None, None), [NONE_EXC_STRING])
608 self.assertEqual(
609 traceback.format_exception_only(None), [NONE_EXC_STRING])
610 self.assertEqual(
611 traceback.format_exception_only(None, None), [NONE_EXC_STRING])
612
613 def test_signatures(self):
614 self.assertEqual(

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected