MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_cleanout_elements

Method test_cleanout_elements

test/base/test_utils.py:47–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45class WeakSequenceTest(fixtures.TestBase):
46 @testing.requires.predictable_gc
47 def test_cleanout_elements(self):
48 class Foo:
49 pass
50
51 f1, f2, f3 = Foo(), Foo(), Foo()
52 w = WeakSequence([f1, f2, f3])
53 eq_(len(w), 3)
54 eq_(len(w._storage), 3)
55 del f2
56 gc_collect()
57 eq_(len(w), 2)
58 eq_(len(w._storage), 2)
59
60 @testing.requires.predictable_gc
61 def test_cleanout_appended(self):

Callers

nothing calls this directly

Calls 3

WeakSequenceClass · 0.90
eq_Function · 0.90
FooClass · 0.70

Tested by

no test coverage detected