Skip to content

Commit cb4550b

Browse files
committed
Restore support in tests for Sphinx<7.2
1 parent 7fb7372 commit cb4550b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22

33
import pytest
44

5+
import sphinx
6+
57
pytest_plugins = 'sphinx.testing.fixtures'
68

79

810
@pytest.fixture(scope='session')
911
def rootdir():
12+
if sphinx.version_info[:2] < (7, 2):
13+
from sphinx.testing.path import path
14+
15+
return path(__file__).parent.abspath() / 'roots'
16+
1017
return Path(__file__).resolve().parent / 'roots'

tests/test_applehelp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ def check_localization(outdir):
3131
confoverrides={'applehelp_bundle_id': 'org.sphinx-doc.Sphinx.help',
3232
'applehelp_disable_external_tools': True})
3333
def test_applehelp_output(app, status, warning):
34-
(app.srcdir / 'en.lproj').mkdir(parents=True, exist_ok=True)
35-
(app.srcdir / 'en.lproj' / 'localized.txt').touch()
34+
LPROJ_DIR = Path(app.srcdir / 'en.lproj')
35+
LPROJ_DIR.mkdir(parents=True, exist_ok=True)
36+
LPROJ_DIR.joinpath('localized.txt').touch()
3637
app.builder.build_all()
3738

3839
# Have to use bundle_path, not outdir, because we alter the latter

0 commit comments

Comments
 (0)