Skip to content

Commit

Permalink
ci: Toggle type of rootdir for sphinx version
Browse files Browse the repository at this point in the history
- This is for pass tests using sphinx.testing.path  with sphinx 8.2.x
- But some tests are failure by bug of itself.

Refs: #189
  • Loading branch information
attakei committed Feb 21, 2025
1 parent 913ae6e commit f85516b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
"""Configuration for pytest."""

import inspect
from pathlib import Path

import pytest
from _pytest.config import Config
from packaging import version
from sphinx import deprecation
from sphinx.testing.path import path

from sphinx_revealjs.deprecated import _get_sphinx_version

pytest_plugins = "sphinx.testing.fixtures"
collect_ignore = ["roots"]
Expand All @@ -23,4 +26,10 @@ def pytest_configure(config: Config): # noqa
@pytest.fixture(scope="session")
def rootdir():
"""Set root directory to use testing sphinx project."""
return path(__file__).parent.abspath() / "roots"
current_ver = _get_sphinx_version()
delimter_ver = version.parse("7.2.0")
if current_ver < delimter_ver:
from sphinx.testing.path import path

return path(__file__).parent.abspath() / "roots"
return Path(__file__).parent.resolve() / "roots"

0 comments on commit f85516b

Please sign in to comment.