()
| 246 | |
| 247 | |
| 248 | def test_random_state_data(): |
| 249 | np = pytest.importorskip("numpy") |
| 250 | seed = 37 |
| 251 | state = np.random.RandomState(seed) |
| 252 | n = 10000 |
| 253 | |
| 254 | # Use an integer |
| 255 | states = random_state_data(n, seed) |
| 256 | assert len(states) == n |
| 257 | |
| 258 | # Use RandomState object |
| 259 | states2 = random_state_data(n, state) |
| 260 | for s1, s2 in zip(states, states2): |
| 261 | assert s1.shape == (624,) |
| 262 | assert (s1 == s2).all() |
| 263 | |
| 264 | # Consistent ordering |
| 265 | states = random_state_data(10, 1234) |
| 266 | states2 = random_state_data(20, 1234)[:10] |
| 267 | |
| 268 | for s1, s2 in zip(states, states2): |
| 269 | assert (s1 == s2).all() |
| 270 | |
| 271 | |
| 272 | def test_memory_repr(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…