Skip to content

[TEST] Golden file test infrastructure for JSON Schema baselines#471

Open
Seth Fitzsimmons (mojodna) wants to merge 1 commit intodevfrom
golden-json-schemas
Open

[TEST] Golden file test infrastructure for JSON Schema baselines#471
Seth Fitzsimmons (mojodna) wants to merge 1 commit intodevfrom
golden-json-schemas

Conversation

@mojodna
Copy link
Collaborator

Extracts shared golden-file comparison boilerplate from 16 JSON Schema baseline tests into tests/golden_support.py, reducing each test to a declarative call.

Changes:

  • tests/golden_support.py: assert_golden compares strings against golden files with unified diff on mismatch; assert_json_schema_golden generates a Pydantic JSON Schema and delegates to assert_golden
  • Root conftest.py: registers --update-baselines flag and update_baselines fixture
  • pyproject.toml: registers baseline marker for selective test runs
  • All 16 baseline test files simplified from ~35 lines to ~10 lines each

Net: -128 lines across test files.

Closes #470

tests/golden_support.py: assert_golden compares strings against
golden files with unified diff on mismatch. assert_json_schema_golden
generates a Pydantic JSON Schema and delegates to assert_golden.

Root conftest.py registers --update-baselines flag and
update_baselines fixture. Baseline marker registered in
pyproject.toml for selective test runs.

Signed-off-by: Seth Fitzsimmons <sethfitz@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TEST] Golden file test infrastructure for JSON Schema baselines

1 participant