Skip to content

Commit 7654462

Browse files
authored
🔧 TESTS: Fix for sphinx 4.4 (#508)
1 parent ee5ff3b commit 7654462

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

tests/test_renderers/test_fixtures_sphinx.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ def test_sphinx_directives(file_params):
4747
pytest.skip(file_params.title)
4848
elif file_params.title.startswith("SPHINX4") and sphinx.version_info[0] < 4:
4949
pytest.skip(file_params.title)
50-
document = to_docutils(file_params.content, in_sphinx_env=True)
51-
file_params.assert_expected(document.pformat(), rstrip_lines=True)
50+
document = to_docutils(file_params.content, in_sphinx_env=True).pformat()
51+
# see https://github.com/sphinx-doc/sphinx/issues/9827
52+
document = document.replace('<glossary sorted="False">', "<glossary>")
53+
file_params.assert_expected(document, rstrip_lines=True)
5254

5355

5456
@pytest.mark.param_file(FIXTURE_PATH / "sphinx_roles.md")

tests/test_sphinx/test_sphinx_builds.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ def test_fieldlist_extension(
531531
docname="index",
532532
regress=True,
533533
regress_ext=f".sphinx{sphinx.version_info[0]}.xml",
534+
# changed in:
535+
# https://www.sphinx-doc.org/en/master/changes.html#release-4-4-0-released-jan-17-2022
536+
replace={
537+
(
538+
'<literal_strong py:class="True" '
539+
'py:module="True" refspecific="True">'
540+
): "<literal_strong>"
541+
},
534542
)
535543
finally:
536544
get_sphinx_app_output(

tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<bullet_list>
3838
<list_item>
3939
<paragraph>
40-
<literal_strong py:class="True" py:module="True" refspecific="True">
40+
<literal_strong>
4141
sender
4242
(
4343
<pending_xref py:class="True" py:module="True" refdomain="py" refexplicit="False" refspecific="True" reftarget="str" reftype="class">
@@ -48,7 +48,7 @@
4848
The person sending the message
4949
<list_item>
5050
<paragraph>
51-
<literal_strong py:class="True" py:module="True" refspecific="True">
51+
<literal_strong>
5252
priority
5353
(
5454
<pending_xref py:class="True" py:module="True" refdomain="py" refexplicit="False" refspecific="True" reftarget="int" reftype="class">

tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<bullet_list>
3838
<list_item>
3939
<paragraph>
40-
<literal_strong py:class="True" py:module="True" refspecific="True">
40+
<literal_strong>
4141
sender
4242
(
4343
<pending_xref py:class="True" py:module="True" refdomain="py" refexplicit="False" refspecific="True" reftarget="str" reftype="class">
@@ -48,7 +48,7 @@
4848
The person sending the message
4949
<list_item>
5050
<paragraph>
51-
<literal_strong py:class="True" py:module="True" refspecific="True">
51+
<literal_strong>
5252
priority
5353
(
5454
<pending_xref py:class="True" py:module="True" refdomain="py" refexplicit="False" refspecific="True" reftarget="int" reftype="class">

0 commit comments

Comments
 (0)