Use pytest-randomly for reproducible random test parameters#5868
Use pytest-randomly for reproducible random test parameters#5868CirqBot merged 16 commits intoquantumlib:masterfrom
Conversation
These instances of seeding do not appear to affect test results.
No need to parametrize for a single set of values, let us set them in the test body instead.
Replaced by pytest-randomly. The seed from pytest-randomly appears to be in effect at the test discovery stage and makes RNG-generated test parameters reproducible.
Avoid using `pytest --quiet` which disables pytest-randomly hook that configures consistent seeding for parallel test jobs. Reverts quantumlib#1825.
These tests are tied to the zero seed of numpy RNG.
|
@vtomole - can you PTAL at this PR? Let me know if there are any questions. Thanks! |
vtomole
left a comment
There was a problem hiding this comment.
Thanks for the ping. Forgot to submit review: LGTM.
|
What happened to #4788 (comment)? |
I believe I was checking the tests with check/pytest script which was executing In short, |
|
Automerge cancelled: A status check is failing. |
…ib#5868) - Require pytest-randomly for the testing to ensure RNG-generated test parameters are consistent across parallel test jobs. - Remove check/pytest option --actually-quiet which disables pytest-randomly hook for seeding parallel test jobs. - Remove `CIRQ_TESTING_RANDOM_SEED` as it is not needed anymore. - Remove RNG seeding in the tests where it seems redundant. - Clean up one instance of unnecessary test parametrization. This upholds quantumlib#4787 and replaces quantumlib#4788. Reverts quantumlib#1825 and obsoletes quantumlib#1826.
…ib#5868) - Require pytest-randomly for the testing to ensure RNG-generated test parameters are consistent across parallel test jobs. - Remove check/pytest option --actually-quiet which disables pytest-randomly hook for seeding parallel test jobs. - Remove `CIRQ_TESTING_RANDOM_SEED` as it is not needed anymore. - Remove RNG seeding in the tests where it seems redundant. - Clean up one instance of unnecessary test parametrization. This upholds quantumlib#4787 and replaces quantumlib#4788. Reverts quantumlib#1825 and obsoletes quantumlib#1826.
parameters are consistent across parallel test jobs.
hook for seeding parallel test jobs.
CIRQ_TESTING_RANDOM_SEEDas it is not needed anymore.This upholds #4787 and replaces #4788.
Reverts #1825 and obsoletes #1826.