1212)
1313
1414
15- def _unpack (snapshot , device = 0 ):
16- timeline , allocs , frames , stacks , categories , max_ts = process_snapshot (snapshot , device )
17- resolved_stacks = [[frames [fi ] for fi in s ] for s in stacks ]
18- return timeline , allocs , resolved_stacks , categories , max_ts
19-
20-
2115DATA_DIR = Path (__file__ ).parent / "data"
2216SNAPSHOT_PATH = DATA_DIR / "mini_snapshot.pickle"
2317
@@ -85,12 +79,11 @@ def test_is_cpython_c_frame(self):
8579
8680class TestProcessSnapshot :
8781 def test_returns_correct_tuple_shape (self , snapshot ):
88- timeline , allocs , frames , stacks , categories , max_ts = process_snapshot (snapshot )
82+ timeline , allocs , frames , stacks , max_ts = process_snapshot (snapshot )
8983 assert len (timeline ) > 0
9084 assert len (allocs ) > 0
9185 assert len (frames ) > 0
9286 assert len (stacks ) > 0
93- assert len (categories ) == len (stacks )
9487 assert max_ts > 0
9588
9689 def test_stacks_reference_valid_frame_indices (self , snapshot ):
@@ -131,7 +124,7 @@ def test_stack_indices_valid(self, snapshot):
131124
132125 def test_empty_device_returns_empty (self , snapshot ):
133126 result = process_snapshot (snapshot , device = 99 )
134- assert result == ([], [], [], [], [], 0 )
127+ assert result == ([], [], [], [], 0 )
135128
136129 def test_polygon_offsets_non_negative (self , snapshot ):
137130 _ , allocs , * _ = process_snapshot (snapshot )
@@ -152,7 +145,6 @@ def test_no_remaining_placeholders(self, snapshot):
152145 "__TIMELINE__" ,
153146 "__ALLOCS__" ,
154147 "__STACKS__" ,
155- "__CATEGORIES__" ,
156148 "__META__" ,
157149 ]:
158150 assert placeholder not in html
0 commit comments