From 6626a910e3ad1c9ef833c1d6bde7d485a3914519 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Mar 01 2022 11:57:38 +0000 Subject: Run the tests in %check in parallel with -n auto when possible On my machine (8 workers), it changes the duration from 192.84s to 67.39s. --- diff --git a/pytest.spec b/pytest.spec index 0f350c8..f619658 100644 --- a/pytest.spec +++ b/pytest.spec @@ -135,8 +135,9 @@ find %{buildroot}%{python3_sitelib} \ %if %{with tests} %check %global __pytest %{buildroot}%{_bindir}/pytest +# optional_tests deps contain pytest-xdist, so we can use it to run tests faster # test_errors_in_xfail_skip_expressions: https://github.com/pytest-dev/pytest/issues/9413 -%pytest testing %{?with_timeout:--timeout=30} -rs -k "not test_errors_in_xfail_skip_expressions" +%pytest testing %{?with_timeout:--timeout=30} %{?with_optional_tests:-n auto} -rs -k "not test_errors_in_xfail_skip_expressions" %endif