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

Method test_pickle_explodes

Lib/test/test_enum.py:1854–1861  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1852 self.assertEqual(ReplaceGlobalInt.TWO.__reduce_ex__(proto), 'TWO')
1853
1854 def test_pickle_explodes(self):
1855 BadPickle = Enum(
1856 'BadPickle', 'dill sweet bread-n-butter', module=__name__)
1857 globals()['BadPickle'] = BadPickle
1858 # now break BadPickle to test exception raising
1859 enum._make_class_unpicklable(BadPickle)
1860 test_pickle_exception(self.assertRaises, TypeError, BadPickle.dill)
1861 test_pickle_exception(self.assertRaises, PicklingError, BadPickle)
1862
1863 def test_string_enum(self):
1864 class SkillLevel(str, Enum):

Callers

nothing calls this directly

Calls 2

EnumClass · 0.90
test_pickle_exceptionFunction · 0.85

Tested by

no test coverage detected