Beispiel #1
0
def test_get_counts_allocations():
    lists = []
    objtrace.enable()
    lists.extend([1] for _ in range(100))
    objtrace.disable()
    counts = objtrace.get_counts()
    assert counts[0] > 0
Beispiel #2
0
def reset_objtrace_counts():
    objtrace.reset_counts()
    try:
        yield
    finally:
        objtrace.disable()
        objtrace.reset_counts()
Beispiel #3
0
def test_allocation_counts(reset_objtrace_counts):
    lists = []
    objtrace.enable()
    for _ in range(100):
        lists.append([1])
    objtrace.disable()
    c = objtrace.get_counts()
    assert c[0] > 0
 def test_allocation_counts(self):
     l = []
     objtrace.enable()
     for _ in range(100):
         l.append([1])
     objtrace.disable()
     c = objtrace.get_counts()
     assert (c[0] > 0)
Beispiel #5
0
def test_enables_and_disabled(reset_objtrace_counts):
    objtrace.enable()
    objtrace.get_counts()
    objtrace.disable()
 def test_enables_and_disabled(self):
     objtrace.enable()
     objtrace.get_counts()
     objtrace.disable()
Beispiel #7
0
def test_disable_twice():
    objtrace.disable()
    objtrace.disable()