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

Method test_container_iterator

Lib/test/test_deque.py:730–744  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

728
729 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: False is not true : Cycle was not collected
730 def test_container_iterator(self):
731 # Bug #3680: tp_traverse was not implemented for deque iterator objects
732 class C(object):
733 pass
734 for i in range(2):
735 obj = C()
736 ref = weakref.ref(obj)
737 if i == 0:
738 container = deque([obj, 1])
739 else:
740 container = reversed(deque([obj, 1]))
741 obj.x = iter(container)
742 del obj, container
743 gc.collect()
744 self.assertTrue(ref() is None, "Cycle was not collected")
745
746 check_sizeof = support.check_sizeof
747

Callers

nothing calls this directly

Calls 5

reversedFunction · 0.85
iterFunction · 0.85
collectMethod · 0.80
assertTrueMethod · 0.80
CClass · 0.70

Tested by

no test coverage detected