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

Method test_object_reduce

Lib/test/test_descr.py:5741–5752  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5739 self.assertEqual(A().__reduce_ex__(2), expected) # Shouldn't crash
5740
5741 def test_object_reduce(self):
5742 # Issue #29914
5743 # __reduce__() takes no arguments
5744 object().__reduce__()
5745 with self.assertRaises(TypeError):
5746 object().__reduce__(0)
5747 # __reduce_ex__() takes one integer argument
5748 object().__reduce_ex__(0)
5749 with self.assertRaises(TypeError):
5750 object().__reduce_ex__()
5751 with self.assertRaises(TypeError):
5752 object().__reduce_ex__(None)
5753
5754
5755class SharedKeyTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

__reduce__Method · 0.45
assertRaisesMethod · 0.45
__reduce_ex__Method · 0.45

Tested by

no test coverage detected