Looking at the py.test documentation it would seem that passing -n NUM
would specify the number of cores to be used.
My experience is the following:
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: -n
If I try to specify it in pytest.ini
(which is my preference) I get the same result.
I'm adding addopts = -n4
to the ini
file, which seems to be what the docs require.
I'm using py.test 2.8, and I've tried both python 2 and python 3.
You need to install xdist
pip install pytest-xdist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With