Skip to content

Commit 56ad6a9

Browse files
ricardoV94twiecki
authored andcommitted
Add explanation to test_sample_does_not_set_seed
1 parent f0c8f55 commit 56ad6a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymc/tests/test_sampling.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ def setup_method(self):
6363
self.model, self.start, self.step, _ = simple_init()
6464

6565
def test_sample_does_not_set_seed(self):
66+
# This tests that when random_seed is None, the global seed is not affected
6667
random_numbers = []
6768
for _ in range(2):
6869
np.random.seed(1)
6970
with self.model:
70-
pm.sample(1, tune=0, chains=1)
71+
pm.sample(1, tune=0, chains=1, random_seed=None)
7172
random_numbers.append(np.random.random())
7273
assert random_numbers[0] == random_numbers[1]
7374

0 commit comments

Comments
 (0)