From e6021da219066506193e054da838ebfddbd05447 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 17 May 2022 10:53:38 +0200 Subject: [PATCH] Improve testing speed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don’t require coverage each time we launch tests. We keep it in the list of dependencies (as it’s always useful to get coverage when needed), but we don’t use the option by default. It doesn’t change the hard requirements for having passing tests, because coverage wasn’t automatically checked. We also use xdist to launch parallel tests on multicore CPUs. Let’s save some time and some energy (the world is burning 🔥) for our CI. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 24c0803b8..953512bb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ Donation = 'https://opencollective.com/courtbouillon' [project.optional-dependencies] doc = ['sphinx', 'sphinx_rtd_theme'] -test = ['pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]'] +test = ['pytest', 'pytest-xdist', 'pytest-flake8', 'pytest-isort', 'pytest-cov', 'coverage[toml]'] [project.scripts] weasyprint = 'weasyprint.__main__:main' @@ -61,7 +61,7 @@ weasyprint = 'weasyprint.__main__:main' exclude = ['.*', 'tests/results'] [tool.pytest.ini_options] -addopts = '--isort --flake8 --cov --no-cov-on-fail' +addopts = '--isort --flake8 --numprocesses=auto' [tool.coverage.run] branch = true