From 9862b6ce938cef678ff3a3931b8da3a11ad9c11b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 15 Apr 2023 13:46:58 +0100 Subject: [PATCH] Run tests in parallel with pytest-xdist --- .github/workflows/ci.yml | 2 +- requirements.txt | 1 + tox.ini | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7cdda633..aee923ba4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - name: Run tests - run: pytest tests + run: pytest -n auto tests docker: strategy: diff --git a/requirements.txt b/requirements.txt index cc729cf64..1b0238073 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,7 @@ pre-commit==3.2.2 # ------------------------------------------------------------------------------ tox==4.4.12 pytest==7.3.1 +pytest-xdist==3.2.1 pytest-cookies==0.7.0 pytest-instafail==0.5.0 pyyaml==6.0 diff --git a/tox.ini b/tox.ini index f0c22d48e..6fd87c4ff 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = py311,black-template [testenv] deps = -rrequirements.txt -commands = pytest {posargs:./tests} +commands = pytest -n auto {posargs:./tests} [testenv:black-template] deps = black