Probabilistic unit tests?

alex23 wuwei23 at
Sat Jan 12 09:07:38 CET 2013

On 11 Jan, 13:34, Steven D'Aprano <steve
+comp.lang.pyt... at> wrote:
> Well, that's not really a task for unit testing. Unit tests, like most
> tests, are well suited to deterministic tests, but not really to
> probabilistic testing. As far as I know, there aren't really any good
> frameworks for probabilistic testing, so you're stuck with inventing your
> own. (Possibly on top of unittest.)

One approach I've had success with is providing a seed to the RNG, so
that the random results are deterministic.

More information about the Python-list mailing list