Skip to content

Commit

Permalink
Restore support in tests for Sphinx<7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 9, 2023
1 parent 7fb7372 commit cb4550b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

import pytest

import sphinx

pytest_plugins = 'sphinx.testing.fixtures'


@pytest.fixture(scope='session')
def rootdir():
if sphinx.version_info[:2] < (7, 2):
from sphinx.testing.path import path

return path(__file__).parent.abspath() / 'roots'

return Path(__file__).resolve().parent / 'roots'
5 changes: 3 additions & 2 deletions tests/test_applehelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ def check_localization(outdir):
confoverrides={'applehelp_bundle_id': 'org.sphinx-doc.Sphinx.help',
'applehelp_disable_external_tools': True})
def test_applehelp_output(app, status, warning):
(app.srcdir / 'en.lproj').mkdir(parents=True, exist_ok=True)
(app.srcdir / 'en.lproj' / 'localized.txt').touch()
LPROJ_DIR = Path(app.srcdir / 'en.lproj')
LPROJ_DIR.mkdir(parents=True, exist_ok=True)
LPROJ_DIR.joinpath('localized.txt').touch()
app.builder.build_all()

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

0 comments on commit cb4550b

Please sign in to comment.