Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Nov 6, 2023
1 parent 1c43107 commit d809a3d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion tests/test_styles/test_style_blank.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from pathlib import Path

import pytest
from sphinx import version_info
from sphinx.builders.html import StandaloneHTMLBuilder


@pytest.mark.parametrize("test_app", [{"buildername": "html", "srcdir": "doc_test/doc_style_blank"}], indirect=True)
def test_doc_style_blank(test_app):
# css_files is not cleared between test runs so css files get
# progressively added. This forces it to clear before re-building
if hasattr(StandaloneHTMLBuilder, "css_files"):
if version_info >= (7, 2):
# TODO changed in sphinx 7.2
if hasattr(StandaloneHTMLBuilder, "_css_files"):
del StandaloneHTMLBuilder._css_files[:]
elif hasattr(StandaloneHTMLBuilder, "css_files"):
del StandaloneHTMLBuilder.css_files[:]

app = test_app
Expand Down
7 changes: 6 additions & 1 deletion tests/test_styles/test_style_custom.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from pathlib import Path

import pytest
from sphinx import version_info
from sphinx.builders.html import StandaloneHTMLBuilder


@pytest.mark.parametrize("test_app", [{"buildername": "html", "srcdir": "doc_test/doc_style_custom"}], indirect=True)
def test_doc_style_custom(test_app):
# css_files is not cleared between test runs so css files get
# progressively added. This forces it to clear before re-building
if hasattr(StandaloneHTMLBuilder, "css_files"):
if version_info >= (7, 2):
# TODO changed in sphinx 7.2
if hasattr(StandaloneHTMLBuilder, "_css_files"):
del StandaloneHTMLBuilder._css_files[:]
elif hasattr(StandaloneHTMLBuilder, "css_files"):
del StandaloneHTMLBuilder.css_files[:]

app = test_app
Expand Down
7 changes: 6 additions & 1 deletion tests/test_styles/test_style_modern.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from pathlib import Path

import pytest
from sphinx import version_info
from sphinx.builders.html import StandaloneHTMLBuilder


@pytest.mark.parametrize("test_app", [{"buildername": "html", "srcdir": "doc_test/doc_style_modern"}], indirect=True)
def test_doc_style_modern(test_app):
# css_files is not cleared between test runs so css files get
# progressively added. This forces it to clear before re-building
if hasattr(StandaloneHTMLBuilder, "css_files"):
if version_info >= (7, 2):
# TODO changed in sphinx 7.2
if hasattr(StandaloneHTMLBuilder, "_css_files"):
del StandaloneHTMLBuilder._css_files[:]
elif hasattr(StandaloneHTMLBuilder, "css_files"):
del StandaloneHTMLBuilder.css_files[:]

app = test_app
Expand Down
7 changes: 6 additions & 1 deletion tests/test_styles/test_style_unknown.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from pathlib import Path

import pytest
from sphinx import version_info
from sphinx.builders.html import StandaloneHTMLBuilder


@pytest.mark.parametrize("test_app", [{"buildername": "html", "srcdir": "doc_test/doc_style_unknown"}], indirect=True)
def test_doc_style_unknown(test_app):
# css_files is not cleared between test runs so css files get
# progressively added. This forces it to clear before re-building
if hasattr(StandaloneHTMLBuilder, "css_files"):
if version_info >= (7, 2):
# TODO changed in sphinx 7.2
if hasattr(StandaloneHTMLBuilder, "_css_files"):
del StandaloneHTMLBuilder._css_files[:]
elif hasattr(StandaloneHTMLBuilder, "css_files"):
del StandaloneHTMLBuilder.css_files[:]

app = test_app
Expand Down

0 comments on commit d809a3d

Please sign in to comment.