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

Method test_traverse_frozen_objects

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

freezeMethod · 0.80
appendMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected