New facility for deterministic and reproducible test PRNGs.
The new testing_rng()
function is meant as a replacement for
thread_rng() for use in unit tests. By default, it uses a randomly
seeded RNG, but prints the seed before the test so that you can
reproduce any failures that occur. You can override this via the
environment to use a previous seed, or by using a deterministic
seed for all your tests.
Backend for #486 (closed).
Edited by Nick Mathewson