Patch-Source: https://github.com/sphinx-contrib/jquery/commit/80d1d3925c17c1860283323972680690f81d7b18 From 80d1d3925c17c1860283323972680690f81d7b18 Mon Sep 17 00:00:00 2001 From: Karolina Surma <33810531+befeleme@users.noreply.github.com> Date: Sat, 13 Jan 2024 04:52:08 +0100 Subject: [PATCH] Enable testing with Sphinx 7.2 (#28) Co-authored-by: Dmitry Shachnev Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> --- .github/workflows/test.yml | 3 ++- tests/test_jquery_installed.py | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2c13fce..d69c7fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/tests/test_jquery_installed.py b/tests/test_jquery_installed.py index 08c25ba..04b17b0 100644 --- a/tests/test_jquery_installed.py +++ b/tests/test_jquery_installed.py @@ -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") @@ -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