From 101176f5bc457bbd9f169bcac3695e3393cc5a55 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Sun, 27 Oct 2024 13:24:08 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Fix=20tests=20for=20latest=20sph?= =?UTF-8?q?inx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_sphinx/conftest.py | 4 ++++ tests/test_sphinx/test_sphinx_builds.py | 2 ++ .../test_references_singlehtml.html | 16 ++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/test_sphinx/conftest.py b/tests/test_sphinx/conftest.py index ab7611a5..cdb2d999 100644 --- a/tests/test_sphinx/conftest.py +++ b/tests/test_sphinx/conftest.py @@ -79,6 +79,10 @@ def read( # pygments 2.11.0 introduces a whitespace tag for pygment_whitespace in doc_div.select("pre > span.w"): pygment_whitespace.replace_with(pygment_whitespace.text) + # something changed in sphinx 8 (or new docutils) to introduce this, although I couldn't find the actual commit, + # but in any case, it's not important for the regression test + for clearer_div in doc_div.findAll("div", {"class": "clearer"}): + clearer_div.decompose() text = doc_div.prettify() # changed in sphinx 7.2 text = text.replace('"Link to this', '"Permalink to this') diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index 12db6c9f..8beb8748 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -178,6 +178,8 @@ def test_references_singlehtml( # changed in sphinx 7.3 '="#document-index': '="index.html#document-index', '="#document-other': '="index.html#document-other', + # change in sphinx 8 + 'href="index.html#': 'href="#', }, ) diff --git a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.html b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.html index 643e868d..ac9ec0b7 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.html +++ b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.html @@ -29,28 +29,28 @@

- + Other 2 Title

- + Other 2 Title

- + Other 2 Title

- + Title @@ -71,21 +71,21 @@

- + Other Title

- + Other Title

- + Other Title @@ -99,7 +99,7 @@

- + Other Title