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
{{ message }}
Repository navigation
Update AGENTS.md and harden tests/_docs_codeblocks.py #222
Three small follow-up housekeeping items remained out of scope for #219 and #220: AGENTS.md still describes README.md as >>>-only doctests, _make_sandbox_env in tests/_docs_codeblocks.py inherits PYTEST_ADDOPTS from the outer environment into inner pytest subprocesses, and _run_fire_evidence_command leaves rg output unsorted compared with its fallback branch.
Motivation
AGENTS.md describes README.md as Doctested quickstart — every >>> block is a real test, even though docs(readme): Refresh quickstart and cut boxes #220 replaced README.md's >>> doctests with plain python and runnable console fences executed by tests/_docs_codeblocks.py.
_make_sandbox_env strips COVERAGE_PROCESS_START and COV_CORE_SOURCE from child subprocesses, but leaves PYTEST_ADDOPTS intact; an externally exported PYTEST_ADDOPTS (such as -k, -m documentation, or --junitxml) can alter or break inner pytest runs launched for plain python test blocks and runnable pytest console blocks.
In _run_fire_evidence_command, the no-rg fallback sorts evidence_dir.rglob("fire.json"), whereas the rg branch compares raw rg --files line order against cmd.expected_output, which is non-deterministic across filesystems and thread scheduling if multi-line expected output is added to a FIRE console block.
Proposal
Update the README.md row in AGENTS.md to reflect that README.md code blocks run via tests/_docs_codeblocks.py alongside doctests.
Clear PYTEST_ADDOPTS (env.pop("PYTEST_ADDOPTS", None)) inside _make_sandbox_env in tests/_docs_codeblocks.py, with a unit test confirming an exported PYTEST_ADDOPTS does not affect inner pytest execution.
Sort normalized lines in the rg branch of _run_fire_evidence_command so its output order matches the sorted(evidence_dir.rglob("fire.json")) fallback.
Activity