@@ -126,14 +126,17 @@ def label_for_core(core):
126126 raise ValueError (f"Bad core: { core !r} " )
127127
128128
129- def should_skip (core ):
129+ def should_skip (core , metacov ):
130130 """Is there a reason to skip these tests?
131131
132132 Return empty string to run tests, or a message about why we are skipping
133133 the tests.
134134 """
135135 skipper = ""
136136
137+ if metacov and core == "sysmon" and ((3 , 12 ) <= sys .version_info < (3 , 14 )):
138+ skipper = "sysmon can't measure branches in Python 3.12-3.13"
139+
137140 # $set_env.py: COVERAGE_TEST_CORES - List of cores to run: ctrace, pytrace, sysmon
138141 test_cores = os .getenv ("COVERAGE_TEST_CORES" )
139142 if test_cores :
@@ -154,7 +157,8 @@ def should_skip(core):
154157 skipper = f"No C core for { platform .python_implementation ()} "
155158
156159 if skipper :
157- return f"Skipping tests { label_for_core (core )} : { skipper } "
160+ what = "metacov" if metacov else "tests"
161+ return f"Skipping { what } { label_for_core (core )} : { skipper } "
158162 else :
159163 return ""
160164
@@ -226,11 +230,6 @@ def run_tests_with_coverage(core, *runner_args):
226230 del sys .modules [name ]
227231 remove_extension (core )
228232
229- # Remove the reference to metacov.ini.
230- del os .environ ["COVERAGE_PROCESS_START" ]
231- os .environ ["COVERAGE_DEBUG" ] = "sys,config,trace"
232- os .environ ["COVERAGE_DEBUG_FILE" ] = "/tmp/foo.out"
233-
234233 import coverage # pylint: disable=reimported
235234
236235 sys .modules .update (covmods )
@@ -268,15 +267,17 @@ def do_combine_html():
268267
269268def do_test_with_core (core , * runner_args ):
270269 """Run tests with a particular core."""
270+ metacov = os .getenv ("COVERAGE_COVERAGE" , "no" ) == "yes"
271+
271272 # If we should skip these tests, skip them.
272- skip_msg = should_skip (core )
273+ skip_msg = should_skip (core , metacov )
273274 if skip_msg :
274275 if VERBOSITY > 0 :
275276 print (skip_msg )
276277 return None
277278
278279 os .environ ["COVERAGE_CORE" ] = core
279- if os . getenv ( "COVERAGE_COVERAGE" , "no" ) == "yes" :
280+ if metacov :
280281 return run_tests_with_coverage (core , * runner_args )
281282 else :
282283 return run_tests (core , * runner_args )
0 commit comments