PY-TEST0017 · broad_example_property_candidate_count
Count broad literal example families that should state one generated property.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”Find sibling tests with the same syntax after literals are replaced by typed slots. Require at
least minimum_cases distinct literal vectors. A large homogeneous example family is evidence
that the suite is enumerating a domain around one invariant, which Hypothesis can generate and
shrink more directly. The default boundary is ten examples.
Evidence
Section titled “Evidence”Each finding reports the exact example count and literal-neutral test shape. The value is the
number of broad example families. PY-TEST0003 owns shorter families that should use ordinary
Pytest parametrization.
Exceptions
Section titled “Exceptions”Repeated vectors, different control flow, fixtures, call targets, marks, or literal types form different groups or abstain. Keep explicit examples when every case has distinct domain meaning, marks, or identifiers. A property test must state an invariant rather than merely generating the old examples.
Examples
Section titled “Examples”Bad
Ten sibling `test_round_trip_*` tests differ only in one integer input, so the value is `1`.
GoodThree named test_protocol_* scenarios state distinct behavior, so the value remains 0.
References
Section titled “References”- Cites “Hypothesis documentation”, when to use property-based testing. Open reference
- Cites “pytest documentation”, parametrization. Open reference