Skip to content

feat: extend assert_parameter with attribute checking#2

Open
bluefing wants to merge 1 commit intoDataBooth:mainfrom
bluefing:feat/assert-flag
Open

feat: extend assert_parameter with attribute checking#2
bluefing wants to merge 1 commit intoDataBooth:mainfrom
bluefing:feat/assert-flag

Conversation

@bluefing
Copy link
Copy Markdown

@bluefing bluefing commented Apr 7, 2026

Extends assert_parameter() with optional **kwargs for verifying parameter attributes from the just dump payload.

Changes

  • assert_parameter(recipe, param) — existing behaviour, checks parameter exists (unchanged)
  • assert_parameter(recipe, param, short="i", long="interactive") — also checks attributes

Any attribute present in the just dump can be checked: short, long, value, kind, help, pattern, default, export. Unknown attributes raise AssertionError.

Backwards compatible — no changes needed for existing callers.

Tests

7 tests covering: individual attributes, combined attributes, missing parameter, wrong value, and unexpected attribute.

Adds **kwargs support to assert_parameter() so callers can verify
parameter attributes (short, long, value, kind, help, pattern, etc.)
in addition to checking existence. Backwards compatible — existing
calls without kwargs continue to work unchanged.
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com bot commented Apr 7, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  src/pytest_just/fixture.py  17% smaller
  tests/test_assert_parameter.py  0% smaller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant