You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it possible to run Pytest in parallel (#1291)
This PR makes it possible to run parallel Pytest execution via the
`pytest-xdist` plugin.
* Set a fixed random seed for testing, in `src/openfermion/conftest.py`.
This is necessary for `pytest-xdist` worker processes to be able to
perform identical test collections. Otherwise, different workers might
generate different values and you end up with "Inconsistent collection"
errors during execution.
* Change some tests that were writing to fixed-path files and folders.
Those needed to be changed to use temporary directories so that parallel
Pytest processes don't collide trying to write to the same things.
* Add the pytest plugin `pytest-randomly`, which executes tests in
random order, as a way to help make sure that the changes above don't
have some hidden assumption about order of execution.
* Update the requirements files by running the
`re-pip-compile-in-docker.sh` script (necessary because of the addition
of the `pytest-randomly` package).
* Update `CONTRIBUTING.md` to mention the use of options for parallel
testing.
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
0 commit comments