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

Provide a "fixed seed" setting #23

Closed
DRMacIver opened this issue Jan 13, 2015 · 2 comments
Closed

Provide a "fixed seed" setting #23

DRMacIver opened this issue Jan 13, 2015 · 2 comments
Milestone

Comments

@DRMacIver
Copy link
Member

Verifier supports a configurable random number generator and all use of randomness goes through that.

However if you do not provide one it will just create one with the default seed. It is desirable to run tests in a deterministic mode, which you could do by having Verifier create its random with a fixed seed instead.

In this case it would be better to have the randomisation happening per falsify run rather than be on the Verifier object.

Planned solution is to create the seed as some sort of hash of the hypothesis. e.g. use hypothesis.name or inspect.getsource(hypothesis) if hypothesis is a lambda. This ensures tests cannot interfere with each others' randomness.

@DRMacIver DRMacIver added this to the 0.3.1 milestone Jan 13, 2015
@DRMacIver
Copy link
Member Author

Note that you need to be able to easily override this on a per test basis too: Otherwise you can have tests which just by virtue of bad luck will consistently report as unsatisfiable.

@DRMacIver DRMacIver modified the milestones: 0.3.2, 0.3.1 Jan 13, 2015
@DRMacIver
Copy link
Member Author

Fixed in fb24ab4 and released in 0.3.2

DRMacIver added a commit that referenced this issue May 12, 2018
Add an actual working strings provider
Macavirus pushed a commit to Macavirus/hypothesis that referenced this issue May 2, 2022
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

No branches or pull requests

1 participant