You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #108 · Phase 1 · Discovered while red-teaming #109.
Problem
pytest.ini uses the section header [tool:pytest]. That header is only valid in setup.cfg. In a file named pytest.ini, pytest requires [pytest].
pytest still selects the file as its config — and having selected it, stops looking, so pyproject.toml's [tool.pytest.ini_options] is never read.
Verified:
$ pytest tests/unit/test_billable_safety.py --co
rootdir: /Users/jmanning/clustrix
configfile: pytest.ini <- not pyproject.toml
$ pytest --markers | grep -cE "^@pytest.mark.(expensive|real_world|dartmouth_network)"
0 <- no project markers registered at all
$ pytest <file with @pytest.mark.definitely_not_registered_xyz> --co -q
1 test collected <- --strict-markers is NOT active
Everything currently inert
Both files declare these; neither takes effect:
Setting
Intended
Actual
addopts (-v --tb=short --strict-markers, and -n 4 --dist loadfile in pyproject)
applied to every run
ignored
testpaths
limit collection to tests
ignored — bare pytest collects the whole repo
markers (13 of them)
registered
none registered
filterwarnings
suppress paramiko/crypto noise
ignored
--strict-markers
typo in a marker = error
inert
Why this matters beyond tidiness
It invalidates a premise of several other issues.pip install -e ".[dev]" produces an environment where pytest cannot start #110 reports that pip install -e ".[dev]" cannot start pytest because addopts requires xdist. That is true only on branches where pytest.ini is absent — the epic branch deleted it. On master, addopts never applies. Any statement about "the addopts" needs to say which config was live.
--strict-markers being inert hides typos.scripts/test_discovery.py (on the closed epic branch) found 1,532 marker-hygiene issues that a live --strict-markers would have caught at source.
Fix — needs care, do not just flip it
The obvious change ([tool:pytest] → [pytest], or delete pytest.ini so pyproject wins) will activate--strict-markers, testpaths, and possibly -n 4. Any test using an unregistered mark then becomes a hard error, and there are 1,532 known marker issues. Sequence it:
Decide on ONE config source. Recommendation: delete pytest.ini, keep pyproject.toml (it has the fuller marker list — 13 vs 10 — and is the modern convention).
Before activating, inventory every mark actually used: grep -rhoE "@pytest\.mark\.[a-z_]+" tests/ | sort -u and reconcile against the registered list.
Part of #108 · Phase 1 · Discovered while red-teaming #109.
Problem
pytest.iniuses the section header[tool:pytest]. That header is only valid insetup.cfg. In a file namedpytest.ini, pytest requires[pytest].pytest still selects the file as its config — and having selected it, stops looking, so
pyproject.toml's[tool.pytest.ini_options]is never read.Verified:
Everything currently inert
Both files declare these; neither takes effect:
addopts(-v --tb=short --strict-markers, and-n 4 --dist loadfilein pyproject)testpathstestspytestcollects the whole repomarkers(13 of them)filterwarnings--strict-markersWhy this matters beyond tidiness
pip install -e ".[dev]"cannot start pytest becauseaddoptsrequires xdist. That is true only on branches wherepytest.iniis absent — the epic branch deleted it. Onmaster,addoptsnever applies. Any statement about "the addopts" needs to say which config was live.pytest.mark.expensivetoday producesPytestUnknownMarkWarning, not a usable selector.--strict-markersbeing inert hides typos.scripts/test_discovery.py(on the closed epic branch) found 1,532 marker-hygiene issues that a live--strict-markerswould have caught at source.Fix — needs care, do not just flip it
The obvious change (
[tool:pytest]→[pytest], or deletepytest.iniso pyproject wins) will activate--strict-markers,testpaths, and possibly-n 4. Any test using an unregistered mark then becomes a hard error, and there are 1,532 known marker issues. Sequence it:pytest.ini, keeppyproject.toml(it has the fuller marker list — 13 vs 10 — and is the modern convention).grep -rhoE "@pytest\.mark\.[a-z_]+" tests/ | sort -uand reconcile against the registered list.pytest-xdistis installed whereveraddoptswill now apply (ties to pip install -e ".[dev]" produces an environment where pytest cannot start #110).testpathsactivation does not pulltests/real_world/into default runs.--strict-markerslast, once the marker inventory is clean.Config.inifileis the expected file, so a future stray config file cannot silently shadow it again.Verification