Conversation
assume() dropped most draws when the specifier and candidate epochs differed, so Hypothesis intermittently failed HealthCheck.filter_too_much.
|
In case a human reviewer doesn't notice, there's also #1407. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1406.
TestCompatibleReleaseDefinition.test_compatible_release_matches_expected_compatiblesets the independently drawn candidate's epoch to the specifier's withVersion.__replace__instead ofassume(spec_ver.epoch == candidate.epoch). Independent draws often differed in epoch, so Hypothesis sometimes filtered 50 examples before accepting 10 and failedHealthCheck.filter_too_much. Same-epoch coverage is kept, and examples are no longer rejected.Decision
Align epoch on the candidate after generation. Alternatives: generate a shared-epoch pair (open #1407 adds an
epoch=argument onpep440_versionsplus a pair strategy), drop the epoch constraint, or suppressHealthCheck.filter_too_much. This file already derives related versions with__replace__, and sibling~=tests already cover mixed-epoch candidates against the expanded form. Suppressing the health check would leave the filtering in place.Can switch to a composite strategy or to allow mixed epochs.
Test plan
--hypothesis-seed=198before the change
python -m pytest -m property tests/property/test_specifier_matching.py