From f60a10e13b3a6a8d1d27f285d9942b57ab07d0a8 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 6 Aug 2023 15:24:52 +0300 Subject: [PATCH] Make the tests pass with Sphinx 7.1 Update the expected XML files to match Sphinx 7.1 output, and patch Sphinx < 7.1 output to match our new expectations. --- tests/conftest.py | 6 ++++++ tests/test_build/test_basic.xml | 2 +- .../test_conditional_assets_html_assets_policy_index_.xml | 2 +- ...test_conditional_assets_html_assets_policy_no_tabs1_.xml | 2 +- ...test_conditional_assets_html_assets_policy_no_tabs2_.xml | 2 +- tests/test_build/test_conditional_assets_index_.xml | 2 +- tests/test_build/test_conditional_assets_no_tabs1_.xml | 2 +- tests/test_build/test_conditional_assets_no_tabs2_.xml | 2 +- tests/test_build/test_custom_lexer.xml | 2 +- tests/test_build/test_disable_closing.xml | 2 +- tests/test_build/test_disable_css_loading.xml | 2 +- tests/test_build/test_nested_markup.xml | 2 +- tests/test_build/test_no_tabs.xml | 2 +- tests/test_build/test_other_with_assets.xml | 2 +- tests/test_build/test_rinohtype_pdf.xml | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index b1f0728..f776f49 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,7 @@ import pytest from pathlib import Path from bs4 import BeautifulSoup +import sphinx from sphinx.testing.path import path from sphinx_tabs.tabs import FILES @@ -123,6 +124,11 @@ def read(app, docname="index", resolve=False, regress=False, replace=None): text = doctree.pformat() # type: str for find, rep in (replace or {}).items(): text = text.replace(find, rep) + if sphinx.version_info < (7, 1): + text = text.replace( + '', + "", + ) file_regression.check(text, extension=extension) return doctree diff --git a/tests/test_build/test_basic.xml b/tests/test_build/test_basic.xml index f1f6d71..1ef24d7 100644 --- a/tests/test_build/test_basic.xml +++ b/tests/test_build/test_basic.xml @@ -1,4 +1,4 @@ - +