qibocal icon indicating copy to clipboard operation
qibocal copied to clipboard

Prevent tests from failing randomly

Open andrea-pasquale opened this issue 11 months ago • 1 comments

Originally posted by @andrea-pasquale in https://github.com/qiboteam/qibocal/issues/731#issuecomment-1967436824

andrea-pasquale avatar Feb 27 '24 19:02 andrea-pasquale

In general, it is good to fix the seed for tests, because they should be reproducible. If you want more randomness, fix many seeds.

Moreover, for tests that depends on the input, sometimes you may want to apply fuzzing. Hypothesis works quite well, and it is integrated with Pytest (not only).

https://hypothesis.readthedocs.io/en/latest/

alecandido avatar Feb 27 '24 19:02 alecandido