File sphinx-7.2.patch of Package python-sphinxcontrib-applehelp.34925
Index: sphinxcontrib-applehelp-1.0.4/tests/conftest.py
===================================================================
--- sphinxcontrib-applehelp-1.0.4.orig/tests/conftest.py
+++ sphinxcontrib-applehelp-1.0.4/tests/conftest.py
@@ -6,13 +6,13 @@
:license: BSD, see LICENSE for details.
"""
-import pytest
+from pathlib import Path
-from sphinx.testing.path import path
+import pytest
pytest_plugins = 'sphinx.testing.fixtures'
@pytest.fixture(scope='session')
def rootdir():
- return path(__file__).parent.abspath() / 'roots'
+ return Path(__file__).resolve().parent / 'roots'
Index: sphinxcontrib-applehelp-1.0.4/tests/test_applehelp.py
===================================================================
--- sphinxcontrib-applehelp-1.0.4.orig/tests/test_applehelp.py
+++ sphinxcontrib-applehelp-1.0.4/tests/test_applehelp.py
@@ -8,17 +8,16 @@
:license: BSD, see LICENSE for details.
"""
+from pathlib import Path
import plistlib
import pytest
-from sphinx.testing.path import path
-
def check_structure(outdir):
contentsdir = outdir / 'Contents'
- assert contentsdir.isdir()
- assert (contentsdir / 'Info.plist').isfile()
+ assert contentsdir.is_dir()
+ assert (contentsdir / 'Info.plist').is_file()
with open(contentsdir / 'Info.plist', 'rb') as f:
plist = plistlib.load(f)
@@ -26,13 +25,13 @@ def check_structure(outdir):
assert len(plist)
assert plist.get('CFBundleIdentifier', None) == 'org.sphinx-doc.Sphinx.help'
- assert (contentsdir / 'Resources').isdir()
- assert (contentsdir / 'Resources' / 'en.lproj').isdir()
+ assert (contentsdir / 'Resources').is_dir()
+ assert (contentsdir / 'Resources' / 'en.lproj').is_dir()
def check_localization(outdir):
lprojdir = outdir / 'Contents' / 'Resources' / 'en.lproj'
- assert (lprojdir / 'localized.txt').isfile()
+ assert (lprojdir / 'localized.txt').is_file()
@pytest.mark.sphinx(
@@ -40,13 +39,13 @@ 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').makedirs()
- (app.srcdir / 'en.lproj' / 'localized.txt').write_text('')
+ (app.srcdir / 'en.lproj').mkdir(parents=True, exist_ok=True)
+ (app.srcdir / 'en.lproj' / 'localized.txt').touch()
app.builder.build_all()
# Have to use bundle_path, not outdir, because we alter the latter
# to point to the lproj directory so that the HTML arrives in the
# correct location.
- bundle_path = path(app.builder.bundle_path)
+ bundle_path = Path(app.builder.bundle_path)
check_structure(bundle_path)
check_localization(bundle_path)