In stateful test, If I use a fixed seed and setting.derandomize(True or False) together, what is the behavior of the randomize?
what confuse me is the following scenarios:
when I use a fixed seed and settings.derandomize=False, I will get different result when I rerun the test.
but when I use a fixed seed and settings.derandomize=True, I can get the same result when I rerun the test.
I want to find out why I get different result on different runs in the first scenario。 but I don't know how to do.
derandomize=Truehas two effects:The idea is that the
@seed(...)decorator is meant to help you reproduce a failure which was e.g. found in CI, and so replaying old examples is probably helpful or at worst adds a bit of latency; whereas if you passderandomize=Trueyou actually want determinism.You can read more about this in our docs. Fixed seeds can be convenient due to the command-line support via our Pytest plugin, but I'd generally avoid them otherwise in favor of the database and
@reproduce_failure().