From 7654462dc8521c0090478efa4dcfba6227e97a84 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 19 Jan 2022 08:51:19 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20TESTS:=20Fix=20for=20sphinx=204.?= =?UTF-8?q?4=20(#508)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_renderers/test_fixtures_sphinx.py | 6 ++++-- tests/test_sphinx/test_sphinx_builds.py | 8 ++++++++ .../test_fieldlist_extension.sphinx3.xml | 4 ++-- .../test_fieldlist_extension.sphinx4.xml | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/test_renderers/test_fixtures_sphinx.py b/tests/test_renderers/test_fixtures_sphinx.py index 06a38857..44a7d9e3 100644 --- a/tests/test_renderers/test_fixtures_sphinx.py +++ b/tests/test_renderers/test_fixtures_sphinx.py @@ -47,8 +47,10 @@ def test_sphinx_directives(file_params): pytest.skip(file_params.title) elif file_params.title.startswith("SPHINX4") and sphinx.version_info[0] < 4: pytest.skip(file_params.title) - document = to_docutils(file_params.content, in_sphinx_env=True) - file_params.assert_expected(document.pformat(), rstrip_lines=True) + document = to_docutils(file_params.content, in_sphinx_env=True).pformat() + # see https://github.com/sphinx-doc/sphinx/issues/9827 + document = document.replace('', "") + file_params.assert_expected(document, rstrip_lines=True) @pytest.mark.param_file(FIXTURE_PATH / "sphinx_roles.md") diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index c25e17b5..e3025bcd 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -531,6 +531,14 @@ def test_fieldlist_extension( docname="index", regress=True, regress_ext=f".sphinx{sphinx.version_info[0]}.xml", + # changed in: + # https://www.sphinx-doc.org/en/master/changes.html#release-4-4-0-released-jan-17-2022 + replace={ + ( + '' + ): "" + }, ) finally: get_sphinx_app_output( diff --git a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml index d6a886f6..9ce67bb3 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml @@ -37,7 +37,7 @@ - + sender ( @@ -48,7 +48,7 @@ The person sending the message - + priority ( diff --git a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml index 60b8a19b..1fb20d4a 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml @@ -37,7 +37,7 @@ - + sender ( @@ -48,7 +48,7 @@ The person sending the message - + priority (