Skip to content

test: refine replacement property strategy#205

Closed
rlippmann wants to merge 3 commits into
mainfrom
hypothesis-hardening
Closed

test: refine replacement property strategy#205
rlippmann wants to merge 3 commits into
mainfrom
hypothesis-hardening

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

What changed

  • refine the Hypothesis replacement-case strategy in tests/test_properties.py so generated deterministic replacement scenarios directly produce the authoritative initial state under test
  • simplify the replacement property to compare the replacement directive against equivalent explicit public operations on that same generated initial state
  • preserve coverage for old source present/absent, unrelated premise and policies, and normalization-sensitive item identities without mutating the generated state inside the test body

Why

  • the prior property rewrote the generated payload before asserting, which made the invariant harder to reason about
  • generating the actual state under test makes the property closer to the intended contract: replacement should match the equivalent explicit transition sequence from the same authoritative starting state

Checklist

  • pre-commit run (uv run pre-commit run --all-files)
  • tests pass (uv run pytest)

@rlippmann
rlippmann marked this pull request as ready for review July 24, 2026 07:49
@rlippmann

Copy link
Copy Markdown
Owner Author

Closing this stacked PR because it could not be rebased cleanly after PR #204 merged. Reopened the same follow-up change from a fresh branch based on current main.

@rlippmann rlippmann closed this Jul 24, 2026
@rlippmann
rlippmann deleted the hypothesis-hardening branch July 25, 2026 04:41
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