Run test in parallel in Fedora

Sphinx' test run lasts quite long, so running in parallel is beneficial
for everybody building the package.
The parallel run uncovered a test bug, fix for which has been submitted
upstream.
This commit is contained in:
Karolina Surma 2026-06-29 11:20:12 +02:00
commit 49315c5c91
2 changed files with 38 additions and 1 deletions

View file

@ -44,6 +44,10 @@ Patch: sphinx-test_theming.patch
# Fix for test_stemmer failing with Python 3.15+, merged upstream
Patch: https://github.com/sphinx-doc/sphinx/pull/14474.patch
# Fix test_gettext_literalblock_additional failure with pytest-xdist:
# the test used testroot='root' which lacks literalblock.txt
Patch: https://github.com/sphinx-doc/sphinx/pull/14507.patch
# Make the first party extensions optional
# This removes the runtime dependencies on:
# - sphinxcontrib.applehelp
@ -88,6 +92,10 @@ BuildRequires: texinfo
BuildRequires: ImageMagick
%endif
%if %{undefined rhel}
BuildRequires: python%{python3_pkgversion}-pytest-xdist
%endif
%if %{undefined rhel} && %{with latex_tests}
BuildRequires: texlive-collection-fontsrecommended
BuildRequires: texlive-collection-latex
@ -480,7 +488,7 @@ k="${k} and not test_term_in_heading_and_section and not test_IndexBuilder"
k="${k} and not test_check_js_search_indexes"
%endif
%pytest -k "${k}"
%pytest -k "${k}" %{!?rhel:-n auto}
%endif
%files -n python%{python3_pkgversion}-sphinx -f sphinx.lang