From 5a31704d83235eeb49fa799eaf9572c05078e330 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sat, 5 Aug 2023 22:53:30 +0300 Subject: [PATCH] Disable TranslationProgressTotaliser to fix tests with Sphinx 7.1 See https://bugs.debian.org/1042589. --- tests/conftest.py | 10 ++++++++++ tests/test_build.py | 1 + 2 files changed, 11 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index b1f0728..4455a23 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,6 +3,7 @@ from pathlib import Path from bs4 import BeautifulSoup from sphinx.testing.path import path +import sphinx.transforms.i18n from sphinx_tabs.tabs import FILES @@ -21,9 +22,18 @@ def rootdir(): return path(__file__).parent.abspath() / "roots" +@pytest.fixture(autouse=True) +def remove_translation_progress_transform(app): + if hasattr(sphinx.transforms.i18n, "TranslationProgressTotaliser"): + app.registry.transforms.remove( + sphinx.transforms.i18n.TranslationProgressTotaliser + ) + + @pytest.fixture(autouse=True) def auto_build_and_check( app, + remove_translation_progress_transform, status, warning, check_build_success, diff --git a/tests/test_build.py b/tests/test_build.py index 4a21690..865dee5 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -30,6 +30,7 @@ def test_conditional_assets(app, docname, check_asset_links): @pytest.mark.sphinx(testroot="conditionalassets-policy") def test_conditional_assets_html_assets_policy( app, + remove_translation_progress_transform, docname, status, warning,