File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -86,13 +86,12 @@ def __init__(
86
86
core_name = None
87
87
88
88
if core_name is None :
89
- # Someday we will default to sysmon, but it's still experimental:
90
- # if not reason_no_sysmon:
91
- # core_name = "sysmon"
92
- if CTRACER_FILE :
89
+ if env .SYSMON_DEFAULT and not reason_no_sysmon :
90
+ core_name = "sysmon"
91
+ elif CTRACER_FILE :
93
92
core_name = "ctrace"
94
93
else :
95
- if env . CPYTHON and IMPORT_ERROR :
94
+ if IMPORT_ERROR and env . SHIPPING_WHEELS :
96
95
warn (f"Couldn't import C tracer: { IMPORT_ERROR } " , slug = "no-ctracer" , once = True )
97
96
core_name = "pytrace"
98
97
Original file line number Diff line number Diff line change 43
43
# Do we have a GIL?
44
44
GIL = getattr (sys , '_is_gil_enabled' , lambda : True )()
45
45
46
+ # Do we ship compiled coveragepy wheels for this version?
47
+ SHIPPING_WHEELS = CPYTHON and PYVERSION [:2 ] <= (3 , 13 )
48
+
49
+ # Should we default to sys.monitoring?
50
+ SYSMON_DEFAULT = CPYTHON and PYVERSION >= (3 , 14 )
51
+
46
52
# Python behavior.
47
53
class PYBEHAVIOR :
48
54
"""Flags indicating this Python's behavior."""
Original file line number Diff line number Diff line change @@ -1133,11 +1133,12 @@ def test_core_default(self) -> None:
1133
1133
self .make_file ("numbers.py" , "print(123, 456)" )
1134
1134
out = self .run_command ("coverage run --debug=sys numbers.py" )
1135
1135
assert out .endswith ("123 456\n " )
1136
- core = re_line (r" core:" , out ).strip ()
1137
- # if env.PYBEHAVIOR.pep669:
1138
- # assert core == "core: SysMonitor"
1139
1136
warns = re_lines (r"\(no-ctracer\)" , out )
1140
- if self .has_ctracer :
1137
+ core = re_line (r" core:" , out ).strip ()
1138
+ if env .SYSMON_DEFAULT :
1139
+ assert core == "core: SysMonitor"
1140
+ assert not warns
1141
+ elif self .has_ctracer :
1141
1142
assert core == "core: CTracer"
1142
1143
assert not warns
1143
1144
else :
You can’t perform that action at this time.
0 commit comments