Repository navigation
loopguard: pytest asked only to show fixtures, markers or its cache runs no tests - #302
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Conversation
…uns no tests pytest's own help says `--fixtures` (`--funcargs`), `--fixtures-per-test` and `--markers` show what is available, `--setup-plan` shows what would run "but don't execute anything", `--setup-only` sets up fixtures and does "not execute tests", and `--cache-show` does not "perform collection or tests". Only `--collect-only` was read as no run. The others counted as verifications, so an agent that ran `pytest --fixtures` (exit 0) after a failing test run made the turn count as ended green, and the envelope learned from a turn that ended red. They are now read as no run, as `--collect-only` is. `--setup-show`, which shows the setup while it runs the tests, and runs with a path or `-m` still count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pytest's own help says
--fixtures(--funcargs),--fixtures-per-testand--markersshow what is available,--setup-planshows what would run "but don't execute anything",--setup-onlysets up fixtures and does "not execute tests", and--cache-showdoes not "perform collection or tests". Only--collect-onlywas read as no run (_NOT_A_RUN_RE). The others counted as verifications, so an agent that ranpytest --fixtures(exit 0) after a failing test run made the turn count as ended green, and the envelope learned from a turn that ended red.Fix: they are read as no run, as
--collect-onlyis.--setup-show, which shows the setup while it runs the tests, still counts, as do runs given a path such astests/test_markers.pyor-m slow, and an option that only starts with one of these names (--fixtures-dir). The change is the_NOT_A_RUN_REline, apart from the lines #294 and #295 change; the branch merges with both.Tests, in a new
tests/test_loopguard_pytest_listing.py:The skips need Windows, a real agent CLI (Codex, Hermes, opencode) or aider, or a non-root user.
Fixes #298