Debian Codegraph @

tests/test_coverup_81.py

raw symbols SCIP
1 # file scalene/scalene_statistics.py:230-236
2 # lines [232, 233, 234, 235, 236]
3 # branches []
4
5 import pytest
6 from scalene.scalene_statistics import ScaleneStatistics
7
8
9 @pytest.fixture
10 def scalene_statistics():
11 stats = ScaleneStatistics()
12 stats.memory_stats.current_footprint = 100
13 stats.memory_stats.max_footprint = 200
14 stats.memory_stats.max_footprint_loc = ("some_file.py", 10)
15 stats.memory_stats.per_line_footprint_samples[("some_file.py", 10)] = 10
16 yield stats
17 # Cleanup code not necessary as the fixture will provide a fresh instance for each test
18
19
20 def test_clear_all(scalene_statistics):
21 scalene_statistics.clear_all()
22 assert scalene_statistics.memory_stats.current_footprint == 0
23 assert scalene_statistics.memory_stats.max_footprint == 0
24 assert scalene_statistics.memory_stats.max_footprint_loc is None
25 assert len(scalene_statistics.memory_stats.per_line_footprint_samples) == 0