Skip to content

Commit

Permalink
update unit tests for sphinx v7.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Aug 18, 2023
1 parent fbd0e4f commit c744e60
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 1 addition & 4 deletions sphinx_immaterial/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ def init_css_files(self):
if version_info < (7, 2):
self.css_files = [
x
for x in cast(
List[sphinx.builders.html.Stylesheet],
self.css_files,
)
for x in cast(List[sphinx.builders.html.Stylesheet], self.css_files)
if x.filename not in excluded
]
else:
Expand Down
7 changes: 6 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
from typing import Dict

import pytest
from sphinx.testing.path import path as SphinxPath
import sphinx

if sphinx.version_info < (7, 2):
from sphinx.testing.path import path as SphinxPath
else:
from pathlib import Path as SphinxPath # type: ignore[assignment]


pytest_plugins = ("sphinx.testing.fixtures",)
Expand Down
6 changes: 5 additions & 1 deletion tests/python_apigen_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import pathlib

import pytest
import sphinx

from sphinx_immaterial.apidoc.python.apigen import _get_api_data

from sphinx.testing.path import path as SphinxPath
if sphinx.version_info < (7, 2):
from sphinx.testing.path import path as SphinxPath
else:
from pathlib import Path as SphinxPath # type: ignore[assignment]

pytest_plugins = ("sphinx.testing.fixtures",)

Expand Down
6 changes: 5 additions & 1 deletion tests/python_transform_type_annotations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
import pytest

import docutils.nodes
import sphinx
import sphinx.domains.python

from sphinx.testing.path import path as SphinxPath
if sphinx.version_info < (7, 2):
from sphinx.testing.path import path as SphinxPath
else:
from pathlib import Path as SphinxPath # type: ignore[assignment]

pytest_plugins = ("sphinx.testing.fixtures",)

Expand Down

0 comments on commit c744e60

Please sign in to comment.