Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypothesis fixes #591

Merged
merged 2 commits into from
Jun 2, 2020
Merged

Hypothesis fixes #591

merged 2 commits into from
Jun 2, 2020

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

How I did it

Previously, a snapshot was taken at the beginning of each test run and reverted to at the end. This caused an issue where if a test failed, the revert didn't occur and so the previous run's state leaked into future runs as hypothesis shrinks the failing example.

I have adjusted the logic so that the snapshot is only taken prior to the first run, and prior to each subsequent run a revert occurs. Handling these actions before any test logic ensures they always occur, and moving the revert to the beginning means that if a test fails, it's still possible to use -I to drop in with the correct failing state.

Finally, I disabled report_multiple_bugs as a quick solution to the long and difficult-to-read traceback delivered from hypothesis' MultipleFailures.

How to verify it

Run the tests.

The output with multiple bugs is very long and lacks code highlights.
Diabling it is a quick fix to ensure the user gets a more readable
output - long term it would be nice to find a way to format this
output properly.
Copy link
Collaborator

@matnad matnad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@iamdefinitelyahuman iamdefinitelyahuman merged commit 9004853 into master Jun 2, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-hypothesis-revert branch June 2, 2020 12:17
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.

Stateful testing exception output is difficult to read
2 participants