Does anyone know of a @pytestdotorg plugin that cache's
- `random.getstate()`
- `numpy.random.get_state()`
so that, on failure, `--lf` runs under the same pRNG conditions? I can't find one, and that's a really easy bit of #python code to write.
I think it may need to be implicitly done on something like "--replay-np-prng" w/o the monkeypatch, at least for numpy. randomstate doesn't export the cython interface. So, I've had problems with @anacondainc autojit-ing.
But, it's an easy plugin either way.
-
-
P.S. Just looked at your bio. You're clearly the authority here since I just picked up pytest via
@brianokken's book two weeks ago. So your advice is appreciated! My take was from my (possibly overly specific) experience, sorta explained here: https://github.com/numpy/numpy/issues/7861 … -
Now that I think about this out loud though (sorry), my solution wouldn't work. If you do `--lf` and there are many stochastic functions, you don't capture the exact state for an individual test. Has to be function scoped.
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.