Skip to content

Commit 781904d

Browse files
committed
metacov tweaks
1 parent 7ce865f commit 781904d

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

igor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ def run_tests_with_coverage(core, *runner_args):
209209
import coverage
210210

211211
cov = coverage.Coverage(config_file="metacov.ini")
212-
cov.set_option("run:core", "ctrace")
213212
cov._warn_unimported_source = False
214213
cov._warn_preimported_source = False
215214
cov._metacov = True

metacov.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ exclude_lines =
7777
# Lines that will never be called, but satisfy the type checker
7878
pragma: never called
7979

80+
# Code that is never run during metacov, but run during normal tests.
81+
pragma: never metacov
82+
8083
partial_branches =
8184
pragma: part covered
8285
# A for-loop that always hits its break statement

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ def pytest_runtest_call() -> Iterable[None]:
111111
"""Check the exception raised by the test, and skip the test if needed."""
112112
try:
113113
yield
114-
except Exception as e:
114+
except Exception as e: # pragma: never metacov
115+
# This code is for dealing with the exception raised when we are
116+
# measuring with a core that doesn't support branch measurement.
117+
# During metacov, we skip those situations entirely by not running
118+
# sysmon on 3.12 or 3.13, so this code is never needed during metacov.
115119
if getattr(e, "skip_tests", False):
116120
pytest.skip(f"Skipping for exception: {e}")
117121
else:

tests/test_concurrency.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,10 @@ def gwork(q):
363363
assert "Couldn't trace with concurrency=gevent, the module isn't installed.\n" in out
364364
pytest.skip("Can't run test without gevent installed.")
365365
if not testenv.C_TRACER:
366-
if testenv.PY_TRACER:
367-
assert out == (
368-
"Can't support concurrency=gevent with PyTracer, only threads are supported.\n"
369-
)
370-
else:
371-
assert out == (
372-
"Can't use core=sysmon: sys.monitoring doesn't support concurrency=gevent\n"
373-
)
366+
assert testenv.PY_TRACER
367+
assert out == (
368+
"Can't support concurrency=gevent with PyTracer, only threads are supported.\n"
369+
)
374370
pytest.skip(f"Can't run gevent with {testenv.REQUESTED_TRACER_CLASS}.")
375371

376372
assert out == "done\n"

0 commit comments

Comments
 (0)