Skip to content

Commit c10628a

Browse files
committed
CI fixes
1 parent 12c02f6 commit c10628a

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ struct _Py_global_strings {
660660
STRUCT_FOR_ID(only_keys)
661661
STRUCT_FOR_ID(oparg)
662662
STRUCT_FOR_ID(opcode)
663+
STRUCT_FOR_ID(opcodes)
663664
STRUCT_FOR_ID(open)
664665
STRUCT_FOR_ID(opener)
665666
STRUCT_FOR_ID(operation)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/test/test_profiling/test_sampling_profiler/_live_collector_helpers.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,43 @@
11
"""Common test helpers and mocks for live collector tests."""
22

3+
from collections import namedtuple
4+
35
from profiling.sampling.constants import (
46
THREAD_STATUS_HAS_GIL,
57
THREAD_STATUS_ON_CPU,
68
)
79

810

11+
# Matches the C structseq LocationInfo from _remote_debugging
12+
LocationInfo = namedtuple('LocationInfo', ['lineno', 'end_lineno', 'col_offset', 'end_col_offset'])
13+
14+
15+
class MockFrameInfo:
16+
"""Mock FrameInfo for testing.
17+
18+
Frame format: (filename, location, funcname, opcode) where:
19+
- location is a tuple (lineno, end_lineno, col_offset, end_col_offset)
20+
- opcode is an int or None
21+
"""
22+
23+
def __init__(self, filename, lineno, funcname, opcode=None):
24+
self.filename = filename
25+
self.funcname = funcname
26+
self.opcode = opcode
27+
self.location = LocationInfo(lineno, lineno, -1, -1)
28+
29+
def __iter__(self):
30+
return iter((self.filename, self.location, self.funcname, self.opcode))
31+
32+
def __getitem__(self, index):
33+
return (self.filename, self.location, self.funcname, self.opcode)[index]
34+
35+
def __len__(self):
36+
return 4
37+
38+
def __repr__(self):
39+
return f"MockFrameInfo('{self.filename}', {self.location}, '{self.funcname}', {self.opcode})"
40+
941

1042
class MockThreadInfo:
1143
"""Mock ThreadInfo for testing."""

0 commit comments

Comments
 (0)