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

Method test_traverse_frozen_objects

Lib/test/test_gc.py:1168–1178  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1166 self.assertTrue(collected)
1167
1168 def test_traverse_frozen_objects(self):
1169 # See GH-126312: Objects that were not frozen could traverse over
1170 # a frozen object on the free-threaded build, which would cause
1171 # a negative reference count.
1172 x = [1, 2, 3]
1173 gc.freeze()
1174 y = [x]
1175 y.append(y)
1176 del y
1177 gc.collect()
1178 gc.unfreeze()
1179
1180 def test_deferred_refcount_frozen(self):
1181 # Also from GH-126312: objects that use deferred reference counting

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
unfreezeMethod · 0.80
freezeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected