Skip to content

Commit

Permalink
Enable testing with Sphinx 7.2 (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry Shachnev <mitya57@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 13, 2024
1 parent ed84c0d commit 80d1d39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
# - "3.12-dev"
- "3.12"
- "3.13-dev"
sphinx:
- "4" # jQuery included
- "5" # jQuery deprecated
Expand Down
14 changes: 10 additions & 4 deletions tests/test_jquery_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

import pytest
import sphinx
from sphinx.testing.path import path
from sphinx.testing.util import SphinxTestApp

from sphinxcontrib.jquery import _FILES, _ROOT_DIR # NoQA

if sphinx.version_info[:2] >= (7, 2):
test_path = Path
else:
from sphinx.testing.path import path as test_path


def run_blank_app(srcdir, **kwargs):
Path(srcdir, "conf.py").write_text("", encoding="ascii")
Expand All @@ -24,11 +28,13 @@ def run_blank_app(srcdir, **kwargs):


@pytest.fixture(scope="function")
def blank_app(tmpdir, monkeypatch):
def blank_app(tmp_path, monkeypatch):
def inner(**kwargs):
return run_blank_app(path(tmpdir), **kwargs)
return run_blank_app(test_path(tmp_path), **kwargs)

monkeypatch.setattr("sphinx.application.abspath", lambda x: x)
# Sphinx>=7.2 doesn't have abspath
if sphinx.version_info[:2] < (7, 2):
monkeypatch.setattr("sphinx.application.abspath", lambda x: x)
yield inner


Expand Down

0 comments on commit 80d1d39

Please sign in to comment.