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

Method test_newobj_not_class

Lib/test/pickletester.py:3500–3507  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3498 self.assertEqual(y.foo, 42)
3499
3500 def test_newobj_not_class(self):
3501 # Issue 24552
3502 if self.py_version < (3, 4):
3503 self.skipTest('not supported in Python < 3.4')
3504 o = SimpleNewObj.__new__(SimpleNewObj)
3505 b = self.dumps(o, 4)
3506 with support.swap_attr(picklecommon, 'SimpleNewObj', 42):
3507 self.assertRaises((TypeError, pickle.UnpicklingError), self.loads, b)
3508
3509 # Register a type with copyreg, with extension code extcode. Pickle
3510 # an object of that type. Check that the resulting pickle uses opcode

Callers

nothing calls this directly

Calls 4

skipTestMethod · 0.80
__new__Method · 0.45
dumpsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected