Skip to content

Commit f60a10e

Browse files
mitya57Daltz333
authored andcommitted
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.
1 parent cd11906 commit f60a10e

15 files changed

+20
-14
lines changed

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pytest
33
from pathlib import Path
44
from bs4 import BeautifulSoup
5+
import sphinx
56
from sphinx.testing.path import path
67

78
from sphinx_tabs.tabs import FILES
@@ -123,6 +124,11 @@ def read(app, docname="index", resolve=False, regress=False, replace=None):
123124
text = doctree.pformat() # type: str
124125
for find, rep in (replace or {}).items():
125126
text = text.replace(find, rep)
127+
if sphinx.version_info < (7, 1):
128+
text = text.replace(
129+
'<document source="index.rst">',
130+
"<document source=\"index.rst\" translation_progress=\"{'total': 0, 'translated': 0}\">",
131+
)
126132
file_regression.check(text, extension=extension)
127133

128134
return doctree

tests/test_build/test_basic.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<container classes="sphinx-tabs" type="tab-element">
33
<div aria-label="Tabbed content" classes="closeable" role="tablist">
44
<button aria-controls="panel-0-0-0" aria-selected="true" classes="sphinx-tabs-tab" ids="tab-0-0-0" name="0-0" role="tab" tabindex="0">

tests/test_build/test_conditional_assets_html_assets_policy_index_.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<compound classes="toctree-wrapper">
33
<toctree caption="True" entries="(None,\ 'no_tabs1') (None,\ 'no_tabs2')" glob="False" hidden="False" includefiles="no_tabs1 no_tabs2" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
44
<section ids="fruits" names="fruits">

tests/test_build/test_conditional_assets_html_assets_policy_no_tabs1_.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<compound classes="toctree-wrapper">
33
<toctree caption="True" entries="(None,\ 'no_tabs1') (None,\ 'no_tabs2')" glob="False" hidden="False" includefiles="no_tabs1 no_tabs2" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
44
<section ids="fruits" names="fruits">

tests/test_build/test_conditional_assets_html_assets_policy_no_tabs2_.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<compound classes="toctree-wrapper">
33
<toctree caption="True" entries="(None,\ 'no_tabs1') (None,\ 'no_tabs2')" glob="False" hidden="False" includefiles="no_tabs1 no_tabs2" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
44
<section ids="fruits" names="fruits">

tests/test_build/test_conditional_assets_index_.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<compound classes="toctree-wrapper">
33
<toctree caption="True" entries="(None,\ 'no_tabs1') (None,\ 'no_tabs2')" glob="False" hidden="False" includefiles="no_tabs1 no_tabs2" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
44
<section ids="fruits" names="fruits">

tests/test_build/test_conditional_assets_no_tabs1_.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<compound classes="toctree-wrapper">
33
<toctree caption="True" entries="(None,\ 'no_tabs1') (None,\ 'no_tabs2')" glob="False" hidden="False" includefiles="no_tabs1 no_tabs2" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
44
<section ids="fruits" names="fruits">

tests/test_build/test_conditional_assets_no_tabs2_.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<compound classes="toctree-wrapper">
33
<toctree caption="True" entries="(None,\ 'no_tabs1') (None,\ 'no_tabs2')" glob="False" hidden="False" includefiles="no_tabs1 no_tabs2" includehidden="False" maxdepth="-1" numbered="0" parent="index" rawentries="" titlesonly="False">
44
<section ids="fruits" names="fruits">

tests/test_build/test_custom_lexer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<container classes="sphinx-tabs" type="tab-element">
33
<div aria-label="Tabbed content" classes="closeable" role="tablist">
44
<button aria-controls="panel-0-QllP" aria-selected="true" classes="sphinx-tabs-tab code-tab group-tab" ids="tab-0-QllP" name="QllP" role="tab" tabindex="0">

tests/test_build/test_disable_closing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<document source="index.rst">
1+
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
22
<container classes="sphinx-tabs" type="tab-element">
33
<div aria-label="Tabbed content" role="tablist">
44
<button aria-controls="panel-0-0-0" aria-selected="true" classes="sphinx-tabs-tab" ids="tab-0-0-0" name="0-0" role="tab" tabindex="0">

0 commit comments

Comments
 (0)