Skip to content

Commit 9d3956d

Browse files
committed
fixup! Update Lib/test/test_profiling/test_sampling_profiler.py
1 parent a780144 commit 9d3956d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Lib/test/test_profiling/test_sampling_profiler.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ def test_flamegraph_collector_basic(self):
447447

448448
# Test collecting sample data
449449
test_frames = [
450-
(1, [("file.py", 10, "func1"), ("file.py", 20, "func2")])
450+
MockInterpreterInfo(
451+
0,
452+
[MockThreadInfo(1, [("file.py", 10, "func1"), ("file.py", 20, "func2")])],
453+
)
451454
]
452455
collector.collect(test_frames)
453456

@@ -473,14 +476,22 @@ def test_flamegraph_collector_export(self):
473476

474477
collector = FlamegraphCollector()
475478

476-
# Create some test data
479+
# Create some test data (use Interpreter/Thread objects like runtime)
477480
test_frames1 = [
478-
(1, [("file.py", 10, "func1"), ("file.py", 20, "func2")])
481+
MockInterpreterInfo(
482+
0,
483+
[MockThreadInfo(1, [("file.py", 10, "func1"), ("file.py", 20, "func2")])],
484+
)
479485
]
480486
test_frames2 = [
481-
(1, [("file.py", 10, "func1"), ("file.py", 20, "func2")])
487+
MockInterpreterInfo(
488+
0,
489+
[MockThreadInfo(1, [("file.py", 10, "func1"), ("file.py", 20, "func2")])],
490+
)
482491
] # Same stack
483-
test_frames3 = [(1, [("other.py", 5, "other_func")])]
492+
test_frames3 = [
493+
MockInterpreterInfo(0, [MockThreadInfo(1, [("other.py", 5, "other_func")])])
494+
]
484495

485496
collector.collect(test_frames1)
486497
collector.collect(test_frames2)

0 commit comments

Comments
 (0)