예제 #1
0
def test_gc_manager_timing():
    with gc_manager() as m:
        for i in range(10):
            m.collect()
            cycle = []
            cycle.append(cycle)
        assert m.collection_time > 0
예제 #2
0
def test_gc_manager():
    gc.disable()
    assert not gc.callbacks

    with gc_manager(enabled=True) as m:
        assert gc.callbacks
        assert gc.isenabled()

    # Make sure we've rolled back the old state of ``gc``.
    assert not gc.callbacks
    assert not gc.isenabled()