Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the tests pass with Sphinx 7.1 #178

Merged
merged 1 commit into from Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/conftest.py
Expand Up @@ -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
Expand Down Expand Up @@ -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(
'<document source="index.rst">',
"<document source=\"index.rst\" translation_progress=\"{'total': 0, 'translated': 0}\">",
)
file_regression.check(text, extension=extension)

return doctree
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_basic.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<container classes="sphinx-tabs" type="tab-element">
<div aria-label="Tabbed content" classes="closeable" role="tablist">
<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">
Expand Down
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<compound classes="toctree-wrapper">
<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">
<section ids="fruits" names="fruits">
Expand Down
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<compound classes="toctree-wrapper">
<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">
<section ids="fruits" names="fruits">
Expand Down
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<compound classes="toctree-wrapper">
<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">
<section ids="fruits" names="fruits">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_conditional_assets_index_.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<compound classes="toctree-wrapper">
<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">
<section ids="fruits" names="fruits">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_conditional_assets_no_tabs1_.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<compound classes="toctree-wrapper">
<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">
<section ids="fruits" names="fruits">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_conditional_assets_no_tabs2_.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<compound classes="toctree-wrapper">
<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">
<section ids="fruits" names="fruits">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_custom_lexer.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<container classes="sphinx-tabs" type="tab-element">
<div aria-label="Tabbed content" classes="closeable" role="tablist">
<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">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_disable_closing.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<container classes="sphinx-tabs" type="tab-element">
<div aria-label="Tabbed content" role="tablist">
<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">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_disable_css_loading.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<container classes="sphinx-tabs" type="tab-element">
<div aria-label="Tabbed content" classes="closeable" role="tablist">
<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">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_nested_markup.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<section ids="markup-in-tab-titles" names="markup\ in\ tab\ titles">
<title>
Markup in Tab Titles
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_no_tabs.xml
@@ -1,3 +1,3 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<paragraph>
There are no tabs here
2 changes: 1 addition & 1 deletion tests/test_build/test_other_with_assets.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<container classes="sphinx-tabs" type="tab-element">
<div aria-label="Tabbed content" classes="closeable" role="tablist">
<button aria-controls="panel-0-Qysr" aria-selected="true" classes="sphinx-tabs-tab code-tab group-tab" ids="tab-0-Qysr" name="Qysr" role="tab" tabindex="0">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build/test_rinohtype_pdf.xml
@@ -1,4 +1,4 @@
<document source="index.rst">
<document source="index.rst" translation_progress="{'total': 0, 'translated': 0}">
<section ids="testing-pdf" names="testing\ pdf">
<title>
TESTING PDF
Expand Down