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

Improving probabilistic tests #42

Open
smmaurer opened this issue Sep 12, 2018 · 1 comment
Open

Improving probabilistic tests #42

smmaurer opened this issue Sep 12, 2018 · 1 comment

Comments

@smmaurer
Copy link
Member

Some of our unit tests are probabilistic, so they sometimes fail.

The tests are intended to verify that things like sampling weights are being applied correctly. But since the sampling is random, occasionally the tests don't pass. We should make this more sophisticated 🙂

Here's an example of a probabilistic test:
https://github.com/UDST/choicemodels/blob/master/tests/test_mct.py#L46

And a failure that was resolved simply by re-running the test:
https://travis-ci.org/UDST/choicemodels/jobs/427893157

@bridwell
Copy link

I wrote a simple context manager that manages the numpy and python random states. Might be applicable here:

https://github.com/AZMAG/smartpy_core/blob/master/smartpy_core/wrangling.py#L12
https://github.com/AZMAG/smartpy_core/blob/master/smartpy_core/tests/test_wrangling.py#L163

@smmaurer smmaurer changed the title Improve probabilistic tests Improving probabilistic tests Nov 21, 2018
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

2 participants