diff --git a/14507.patch b/14507.patch new file mode 100644 index 0000000..3cea526 --- /dev/null +++ b/14507.patch @@ -0,0 +1,29 @@ +From b9386884a3a4d65db1d69b83026339c5d72442d5 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Mon, 29 Jun 2026 11:00:42 +0200 +Subject: [PATCH] Fix test_gettext_literalblock_additional to use the correct + test root + +test-root doesn't contain the source file for literalblock.pot. The test +passed sequentially because other tests using test root 'intl' left the +file in the same srcdir. With pytest-xdist, the test started correctly failing, +as no leftover file was available during the test run. +Using the test root 'intl', which contains literalblock.txt, fixes the +test. +--- + tests/test_builders/test_build_gettext.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_builders/test_build_gettext.py b/tests/test_builders/test_build_gettext.py +index 30798cc5070..8a1827ba281 100644 +--- a/tests/test_builders/test_build_gettext.py ++++ b/tests/test_builders/test_build_gettext.py +@@ -288,7 +288,7 @@ def test_gettext_prolog_epilog_substitution_excluded(app: SphinxTestApp) -> None + + @pytest.mark.sphinx( + 'gettext', +- testroot='root', ++ testroot='intl', + srcdir='gettext', + confoverrides={ + 'gettext_compact': False, diff --git a/python-sphinx.spec b/python-sphinx.spec index 518787d..2a98fd1 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -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