Skip to content

Commit 30f6576

Browse files
committed
Tests: Skip snippet tests on Sphinx < 7
1 parent 6edce29 commit 30f6576

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ optional-dependencies.test = [
111111
"pytest-cov<8",
112112
"pytest-regressions<3",
113113
"sphinx-pytest<0.3",
114+
"verlib2",
114115
]
115116
urls.changelog = "https://github.com/panodata/sphinx-design-elements/blob/main/CHANGES.md"
116117
urls.documentation = "https://sphinx-design-elements.readthedocs.io/"

tests/test_snippets.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212
from typing import Callable
1313

1414
import pytest
15+
import sphinx
16+
from verlib2 import Version
1517

1618
from tests.conftest import SphinxBuilder
1719

20+
if Version(sphinx.__version__) < Version("7"):
21+
raise pytest.skip("Snippet tests require Sphinx >= 7", allow_module_level=True)
22+
23+
1824
SNIPPETS_PATH = Path(__file__).parent.parent / "docs" / "snippets"
1925
SNIPPETS_GLOB_RST = list((SNIPPETS_PATH / "rst").glob("[!_]*"))
2026
SNIPPETS_GLOB_MYST = list((SNIPPETS_PATH / "myst").glob("[!_]*"))

0 commit comments

Comments
 (0)