Skip to content

Commit c7a5551

Browse files
committed
Run tests in parallel with pytest-xdist
Add pytest-xdist and pytest-sugar to the test deps and switch `make test` to `pytest -n auto`. Keep the serial run available as `test0`, and add `test1` for the xdist run without sugar.
1 parent b105dec commit c7a5551

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,18 @@ fix: format-fix lint-fix
7373
typecheck:
7474
$(UVRUN) pyright
7575

76-
test: clean-test
76+
test0: clean-test
7777
export MATPLOTLIB_BACKEND=agg
7878
$(UVRUN) pytest
7979

80+
test: clean-test
81+
export MATPLOTLIB_BACKEND=agg
82+
$(UVRUN) pytest -n auto
83+
84+
test1: clean-test
85+
export MATPLOTLIB_BACKEND=agg
86+
$(UVRUN) pytest -n auto -p no:sugar
87+
8088
visualize-tests:
8189
$(PYTHON) tools/visualize_tests.py
8290

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ lint = [
6767
]
6868

6969
test = [
70-
"pytest-cov>=4.0.0"
70+
"pytest-cov>=4.0.0",
71+
"pytest-xdist>=3.8.0",
72+
"pytest-sugar>1.1.1",
7173
]
7274

7375
build = [

0 commit comments

Comments
 (0)