From 00f6626ba62e68ad89f7e5b9f56b451e9c30d12f Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 14 Oct 2022 20:58:09 +0200 Subject: [PATCH] Speed up test suite by invoking tests in parallel, using `pytest-xdist` (#690) --- .coveragerc | 3 ++- dev-requirements.txt | 1 + setup.cfg | 2 +- tox.ini | 23 ++++++++++++----------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.coveragerc b/.coveragerc index c0ea1eef..a739da1b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,7 @@ [run] -disable_warnings = no-data-collected +data_file = .coverage-reports/.coverage branch = True +parallel = True source = apprise diff --git a/dev-requirements.txt b/dev-requirements.txt index 34852f59..c87ed27f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,5 +2,6 @@ coverage flake8 pytest pytest-cov +pytest-xdist tox babel diff --git a/setup.cfg b/setup.cfg index 80e6900d..2aa4146c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ builtins = _ test=pytest [tool:pytest] -addopts = --verbose -ra +addopts = --verbosity=3 -ra python_files = test/test_*.py norecursedirs=test/helpers filterwarnings = diff --git a/tox.ini b/tox.ini index 01d9cea3..858e9ca6 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps= -r{toxinidir}/dev-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:py36] @@ -23,7 +23,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:py37] @@ -34,7 +34,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} [testenv:py38] deps= @@ -44,7 +44,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:py39] @@ -55,7 +55,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:py310] @@ -66,7 +66,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics @@ -76,7 +76,7 @@ deps= -r{toxinidir}/dev-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:pypy36] @@ -88,7 +88,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:pypy37] @@ -100,7 +100,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} [testenv:pypy38] deps= @@ -111,7 +111,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:pypy39] @@ -123,7 +123,7 @@ deps= -r{toxinidir}/all-plugin-requirements.txt commands = python setup.py compile_catalog - coverage run --parallel -m pytest {posargs} + coverage run -m pytest {posargs} flake8 . --count --show-source --statistics [testenv:coverage-report] @@ -131,4 +131,5 @@ deps = coverage skip_install = true commands= coverage combine + coverage xml coverage report