Skip to content

test: move pytest spec tests into the regression suite#3

Merged
Yiannis128 merged 1 commit into
masterfrom
move-pytest-tests-to-regression
Jul 16, 2026
Merged

test: move pytest spec tests into the regression suite#3
Yiannis128 merged 1 commit into
masterfrom
move-pytest-tests-to-regression

Conversation

@Yiannis128

Copy link
Copy Markdown
Collaborator

What

Converts tests/test_specs/test_pytest_spec.py (14 unit tests over three real pytest .log files) into three data-driven regression fixtures under tests/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

  • Add samples/pytest/{multiple,successful,multiple_collection_error}.json expected outputs; the three logs move from tests/test_specs/data/pytest/ into the samples dir.
  • Remove test_pytest_spec.py and the now-empty tests/test_specs/data/.
  • CLAUDE.md: the Testing note now says the unit tests cover only what a JSON fixture can't express (auto-detection, hints, derived-property logic, synthetic-spec verdicts).

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

  • Regression suite: 27 passed (24 prior + 3 new pytest fixtures)
  • Unit suite: 23 passed
  • hatch run types:check: clean

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.
@Yiannis128
Yiannis128 merged commit 9170b44 into master Jul 16, 2026
2 of 4 checks passed
@Yiannis128
Yiannis128 deleted the move-pytest-tests-to-regression branch July 16, 2026 23:06
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant