Created
September 24, 2012 12:19
-
-
Save Answeror/3775675 to your computer and use it in GitHub Desktop.
deterministic testing with numpy.random.
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
| from numpy import random | |
| from numpy.random import rand | |
| class TestRandomly(object): | |
| def setUp(self): | |
| self.state = random.get_state() | |
| random.seed(0) | |
| def tearDown(self): | |
| random.set_state(self.state) | |
| def test_adjust_start_point(self): | |
| # do something with rand() | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment