Created
June 24, 2018 16:20
-
-
Save jbn/e97404bfc429592d2427f98163246c85 to your computer and use it in GitHub Desktop.
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
import numpy as np | |
def your_function(x): | |
return x * np.random.rand() | |
# Repeatedly calling this, | |
# pytest --caprng-global-np | |
# from the command line will fail with the same values | |
# over and over again until it passes. | |
def test_your_function(): | |
# pytest --caprng-np | |
assert your_function(10) == 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment