# How to Run Pytest Tests in Parallel?


To run Pytest tests in parallel, install the [pytest-xdist](https://pypi.org/project/pytest-xdist/) plugin:

```command
pip install pytest-xdist
```

Use the following command to run tests in parallel:

```command
pytest -n auto
```

The `-n auto` option tells Pytest to distribute the tests across as many CPUs as your machine has available.

If you want more control and wish to specify the number of CPUs yourself, you can pass a number instead of `auto`:

```command
pytest -n <NUM>
```