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

Method test_issue24097

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

Source from the content-addressed store, hash-verified

5722
5723 @unittest.skip("TODO: RUSTPYTHON")
5724 def test_issue24097(self):
5725 # Slot name is freed inside __getattr__ and is later used.
5726 class S(str): # Not interned
5727 pass
5728 class A:
5729 __slotnames__ = [S('spam')]
5730 def __getattr__(self, attr):
5731 if attr == 'spam':
5732 A.__slotnames__[:] = [S('spam')]
5733 return 42
5734 else:
5735 raise AttributeError
5736
5737 import copyreg
5738 expected = (copyreg.__newobj__, (A,), (None, {'spam': 42}), None, None)
5739 self.assertEqual(A().__reduce_ex__(2), expected) # Shouldn't crash
5740
5741 def test_object_reduce(self):
5742 # Issue #29914

Callers

nothing calls this directly

Calls 3

AClass · 0.70
assertEqualMethod · 0.45
__reduce_ex__Method · 0.45

Tested by

no test coverage detected