From 4d0678ca33b65af2686fe93be5b77c2b28027959 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Fri, 23 May 2025 16:35:57 +0200 Subject: [PATCH 1/2] Add parallel test target, using pytest-xdist --- Makefile | 8 +++++++- pyproject.toml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a8152454..a56fe8fec 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,13 @@ sdist: .PHONY: test test: python3 -c "import pytest" > /dev/null 2>&1 || python3 -m pip install pytest - python3 -m pytest -qq + python3 -m pytest -qq Tests/ + +.PHONY: test-p +test-p: + python3 -c "import xdist" > /dev/null 2>&1 || python3 -m pip install pytest-xdist + python3 -m pytest -qq -n auto Tests/ + .PHONY: valgrind valgrind: diff --git a/pyproject.toml b/pyproject.toml index a3ff9723b..683ab24ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,6 +70,7 @@ optional-dependencies.tests = [ "pytest", "pytest-cov", "pytest-timeout", + "pytest-xdist", "trove-classifiers>=2024.10.12", ] From 6a60b2e6dd0909f627d093cbc431891a79d2b987 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Fri, 30 May 2025 10:27:11 +0100 Subject: [PATCH 2/2] Remove Tests/ path arg, this is already configured --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a56fe8fec..1f9d2ce13 100644 --- a/Makefile +++ b/Makefile @@ -95,12 +95,12 @@ sdist: .PHONY: test test: python3 -c "import pytest" > /dev/null 2>&1 || python3 -m pip install pytest - python3 -m pytest -qq Tests/ + python3 -m pytest -qq .PHONY: test-p test-p: python3 -c "import xdist" > /dev/null 2>&1 || python3 -m pip install pytest-xdist - python3 -m pytest -qq -n auto Tests/ + python3 -m pytest -qq -n auto .PHONY: valgrind