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

Method test_invalid_setstate

Lib/test/test_exceptions.py:605–608  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

603 self.assertEqual(e.b, 2)
604
605 def test_invalid_setstate(self):
606 e = Exception(42)
607 with self.assertRaisesRegex(TypeError, "state is not a dictionary"):
608 e.__setstate__(42)
609
610 def test_notes(self):
611 for e in [BaseException(1), Exception(2), ValueError(3)]:

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.80
__setstate__Method · 0.45

Tested by

no test coverage detected