Question: Hi I am trying to run my tests parallely(pytest-xdist) on the azure pipelines.
Till now the tests were running perfectly fine.
Suddenly the pytest is throwing a weird error saying "unrecognized argument".

The file name : integration\_test.py
Command used : pytest -n 5 --tb=short integration\_test.py -v -s --> to run 5 tests parallely
Total number of tests : 57
Versions :
pytest==6.2.5
pytest-xdist==2.3.0
Even tried with the latest versions of these 2 modules.

Error :
ERROR: usage: pytest [options] [file\_or\_dir] [file\_or\_dir] [...]
pytest: error: unrecognized arguments: -n integration\_test.py

How can I overcome this error?

Answer: 
This error is what you encountered:

[![enter image description here](https://i.stack.imgur.com/O4Jfx.png)](https://i.stack.imgur.com/O4Jfx.png)

As hoefling mentioned, the solution is to install the pytest-xdist:

`pip install pytest-xdist`
On MacOS just running `pytest` might be ran by a different Python's version than you thought.

```
$ pytest
============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.9.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
rootdir: [REDACTED]
plugins: anyio-3.5.0, cov-3.0.0

```

While

```
$ python3 -m pytest
============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.10.6, pytest-7.1.2, pluggy-1.0.0
rootdir: [REDACTED]
plugins: xdist-2.5.0, forked-1.4.0, pylama-8.4.1

```

Be careful, and launch it as a module :)