-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Use pytest-xdist #3707
Use pytest-xdist #3707
Conversation
00298da
to
f1aff2a
Compare
Codecov Report
@@ Coverage Diff @@
## master #3707 +/- ##
=======================================
Coverage 85.42% 85.42%
=======================================
Files 169 169
Lines 9635 9635
Branches 1433 1433
=======================================
Hits 8231 8231
Misses 1156 1156
Partials 248 248 |
Hey! I'm surprised tests pass, I was thinking they won't work out of box 👍 What do you think about adding pytest-xdist to tox, documenting how to use it, but not having |
Then, what about simply installing pytest-xdist and documenting its usage? |
docs/contributing.rst
Outdated
If you have multiple CPU cores, you can use ``-n <number>`` to use a specific | ||
number of CPU cores to run the tests, or ``-n auto`` to use all of them:: | ||
|
||
tox -- scrapy tests -n auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this example tests are executed for all environments; there is a different way to parallelize it (https://tox.readthedocs.io/en/latest/example/basic.html#parallel-mode). I'm not sure what is better, to run individual environments with several processes, or to run environments in parallel in this case. What do you think about having e.g. tox -e py36 -- scrapy tests -n auto
as an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can actually use both in combination, as it turns out, but I guess it’s better to cover them separately, and let developers do what works best for them.
@Gallaecio Thanks, the PR looks great! |
Thanks @Gallaecio! |
In summary:
pytest-xdist
totests/requirements*.txt
and remove versions frompytest*
packages.-n auto
for all environments runningpytest
.pytest-xdist
cleanly, create a new tox environment specifically for Windows that does not usepytest-xdist
(no-n auto
).