Skip to content

Commit 65d1d37

Browse files
[CI] Disable quadrants pytest plugin during quadrants internal coverage runs (#629)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d16692c commit 65d1d37

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/run_tests.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,22 @@ def _test_python(args, default_dir="python"):
3939
try:
4040
if args.coverage:
4141
os.environ.setdefault("QD_KERNEL_COVERAGE", "1")
42+
os.environ["_QD_KCOV_ARC"] = "1"
4243
_spec = importlib.util.find_spec("quadrants")
4344
assert _spec is not None and _spec.origin is not None, "quadrants package not found"
4445
_cov_src = os.path.dirname(_spec.origin)
45-
pytest_args += ["--cov-branch", f"--cov={_cov_src}", f"--cov={test_dir}"]
46+
# Disable the quadrants pytest plugin (pytest11 entry point) during coverage runs. Loading the plugin
47+
# forces Python to import the quadrants parent package before pytest-cov starts measuring, so module-level
48+
# code (imports, def lines, etc.) appears uncovered. The plugin is still useful for *external* users who
49+
# run `pytest --cov` on their own code — they don't measure quadrants' own coverage. We replicate the
50+
# plugin's env-var setup (QD_KERNEL_COVERAGE, _QD_KCOV_ARC) above.
51+
pytest_args += [
52+
"--cov-branch",
53+
f"--cov={_cov_src}",
54+
f"--cov={test_dir}",
55+
"-p",
56+
"no:quadrants",
57+
]
4658
if args.cov_append:
4759
pytest_args += ["--cov-append"]
4860
if args.keys:

0 commit comments

Comments
 (0)