Skip to content

Commit

Permalink
Update tests for cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian committed Jun 12, 2024
1 parent bf61ebe commit e6d7422
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def fun(n):
t.parse()
self.assertEventNumber(t.data, 21)

def test_cleanup(self):
def test_clear(self):
def fib(n):
if n == 1 or n == 0:
return 1
Expand All @@ -59,7 +59,7 @@ def fib(n):
t.start()
fib(5)
t.stop()
t.cleanup()
t.clear()
t.parse()
self.assertEventNumber(t.data, 0)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ def do_one_function(self, func):
func()
baseline = t.get_time()
tracer.stop()
tracer.cleanup()
tracer.clear()

tracer.include_files = ["/"]
tracer.start()
with Timer() as t:
func()
include_files = t.get_time()
tracer.stop()
tracer.cleanup()
tracer.clear()

tracer.include_files = []
tracer.max_stack_depth = 200
Expand All @@ -245,7 +245,7 @@ def do_one_function(self, func):
func()
max_stack_depth = t.get_time()
tracer.stop()
tracer.cleanup()
tracer.clear()

logging.info("Filter performance:")
logging.info(f"Baseline: {baseline:.9f}(1)")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_cleanup(self):
except Exception:
pass
tracer.stop()
tracer.cleanup()
tracer.clear()


class TestFunctionArg(BaseTmpl):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def test_c_cleanup(self):
tracer.start()
fib(5)
tracer.stop()
tracer.cleanup()
tracer.clear()
tracer.cleanup()
tracer.clear()
tracer.clear()


class TestCircularBuffer(BaseTmpl):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_vizobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_exclude(self):
def test_trigger_on_change(self):
tracer = VizTracer(verbose=0)
tracer.stop()
tracer.cleanup()
tracer.clear()
tracer.start()
a = VizObject(tracer, "my variable", trigger_on_change=False)
a.hello = 1
Expand Down

0 comments on commit e6d7422

Please sign in to comment.