From d809a3d455e7713920f1a1adecd7dabf0e21dbc8 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 6 Nov 2023 10:56:26 +0100 Subject: [PATCH] update --- tests/test_styles/test_style_blank.py | 7 ++++++- tests/test_styles/test_style_custom.py | 7 ++++++- tests/test_styles/test_style_modern.py | 7 ++++++- tests/test_styles/test_style_unknown.py | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tests/test_styles/test_style_blank.py b/tests/test_styles/test_style_blank.py index 23c5f57c3..ae34cf0b3 100644 --- a/tests/test_styles/test_style_blank.py +++ b/tests/test_styles/test_style_blank.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest +from sphinx import version_info from sphinx.builders.html import StandaloneHTMLBuilder @@ -8,7 +9,11 @@ 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 diff --git a/tests/test_styles/test_style_custom.py b/tests/test_styles/test_style_custom.py index 8f0225c29..b76fa309b 100644 --- a/tests/test_styles/test_style_custom.py +++ b/tests/test_styles/test_style_custom.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest +from sphinx import version_info from sphinx.builders.html import StandaloneHTMLBuilder @@ -8,7 +9,11 @@ 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 diff --git a/tests/test_styles/test_style_modern.py b/tests/test_styles/test_style_modern.py index 9a2e05bfc..2e8fa8134 100644 --- a/tests/test_styles/test_style_modern.py +++ b/tests/test_styles/test_style_modern.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest +from sphinx import version_info from sphinx.builders.html import StandaloneHTMLBuilder @@ -8,7 +9,11 @@ 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 diff --git a/tests/test_styles/test_style_unknown.py b/tests/test_styles/test_style_unknown.py index 71a70bdb7..6278ce31d 100644 --- a/tests/test_styles/test_style_unknown.py +++ b/tests/test_styles/test_style_unknown.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest +from sphinx import version_info from sphinx.builders.html import StandaloneHTMLBuilder @@ -8,7 +9,11 @@ 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