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