Skip to content

Commit 1f04366

Browse files
committed
Restore support in tests for Sphinx<7.2
1 parent 6f31e2b commit 1f04366

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
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_htmlhelp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test the HTML Help builder and check output against XPath."""
22

33
import re
4+
from pathlib import Path
45

56
import pytest
67
from html5lib import HTMLParser
@@ -55,7 +56,7 @@ def test_chm(app):
5556

5657
# check .hhk file
5758
outname = app.builder.config.htmlhelp_basename
58-
hhk_path = (app.outdir / outname).with_suffix('.hhk')
59+
hhk_path = Path(app.outdir / outname).with_suffix('.hhk')
5960
data = hhk_path.read_bytes()
6061
m = re.search(br'&#[xX][0-9a-fA-F]+;', data)
6162
assert m is None, 'Hex escaping exists in .hhk file: ' + str(m.group(0))

0 commit comments

Comments
 (0)