|
17 | 17 |
|
18 | 18 | import pytest |
19 | 19 |
|
20 | | -from hypothesis import find, given, register_random, reporting, strategies as st |
| 20 | +from hypothesis import core, find, given, register_random, reporting, strategies as st |
21 | 21 | from hypothesis.errors import InvalidArgument |
22 | 22 | from hypothesis.internal import entropy |
23 | 23 | from hypothesis.internal.entropy import deterministic_PRNG |
@@ -120,20 +120,26 @@ def test(r): |
120 | 120 |
|
121 | 121 | test() |
122 | 122 | state_a = random.getstate() |
| 123 | + state_a2 = core._hypothesis_global_random.getstate() |
123 | 124 |
|
124 | 125 | test() |
125 | 126 | state_b = random.getstate() |
| 127 | + state_b2 = core._hypothesis_global_random.getstate() |
126 | 128 |
|
127 | | - assert state_a != state_b |
| 129 | + assert state_a == state_b |
| 130 | + assert state_a2 != state_b2 |
128 | 131 |
|
129 | 132 |
|
130 | 133 | def test_find_does_not_pollute_state(): |
131 | 134 | with deterministic_PRNG(): |
132 | 135 |
|
133 | 136 | find(st.random_module(), lambda r: True) |
134 | 137 | state_a = random.getstate() |
| 138 | + state_a2 = core._hypothesis_global_random.getstate() |
135 | 139 |
|
136 | 140 | find(st.random_module(), lambda r: True) |
137 | 141 | state_b = random.getstate() |
| 142 | + state_b2 = core._hypothesis_global_random.getstate() |
138 | 143 |
|
139 | | - assert state_a != state_b |
| 144 | + assert state_a == state_b |
| 145 | + assert state_a2 != state_b2 |
0 commit comments