New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallelize the test runs via pytest-xdist #2459
Conversation
This PR demonstrates both points raised in #2458:
|
This test seems to fail because |
0e3f505
to
1006870
Compare
62d5ce5
to
5f3d123
Compare
I've already stumbled onto a use-case this breaks. I added a |
I don't have any particular insight into this, but I've recently been working on Django and they have a test runner that defaults to running the tests in parallel and explicitly throws an error if you run |
In this cause, I normally use $ tox -- -n0 -s path/to/test.py::test_something
I believe that it's a bit better with pure pytest: if you actually use $ pytest -n2 --pdb # fails
[...]
ERROR: --pdb is incompatible with distributing tests; try using -n0 or -nauto.
$ pytest --pdb # works
My experience is about the same. I also occasionally do |
Good points. I'm inclined to accept the detriments in favor of the benefits. I've also confirmed that simply passing |
…n in the test suite.
…ke the repair at the session level and only when xdist is present.
832fa0a
to
daf0157
Compare
Summary of changes
This is a demo showing how using pytest-xdist affects the test runs.
Resolves #2458
Performance improvements
Comparing before/after, this patch makes the jobs run 2x faster in the CI and 4x faster locally.
Pull Request Checklist
changelog.d/
.(See documentation for details)