test: move pytest spec tests into the regression suite#3
Merged
Conversation
The pytest unit tests were pure parse-and-assert against real .log files with the registered pytest backend — exactly what the regression suite expresses. Convert the three logs into .log/.json fixtures under tests/regressions/samples/pytest/; the full-JSON comparison subsumes every prior assertion (issue counts, error types, messages, stack-trace lines, severities) and locks in exact messages too. Remove test_pytest_spec.py and the now-empty tests/test_specs/data/. The remaining unit tests cover only what has no JSON representation (auto-detection, hints, derived-property logic, synthetic-spec verdicts); update CLAUDE.md's Testing note to say so.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Converts
tests/test_specs/test_pytest_spec.py(14 unit tests over three real pytest.logfiles) into three data-driven regression fixtures undertests/regressions/samples/pytest/.Why
Those tests were pure parse-a-real-log-with-the-registered-backend and assert on the structured output — precisely what the regression suite is for. The regression runner compares the entire CLI JSON (minus
output), which strictly subsumes every prior assertion (issue counts, error types, messages, stack-trace paths/lines, severities) and additionally locks in the exact messages.Changes
samples/pytest/{multiple,successful,multiple_collection_error}.jsonexpected outputs; the three logs move fromtests/test_specs/data/pytest/into the samples dir.test_pytest_spec.pyand the now-emptytests/test_specs/data/.The unit tests that remain (
test_kani_spec,test_location_features,test_verdict) genuinely can't be fixtures — they test auto-detection, missing-flag hints (excluded from serialized output), derived-property precedence, and synthetic (unregistered) specs.Verification
hatch run types:check: clean