File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import pytest
4
4
5
+ import sphinx
6
+
5
7
pytest_plugins = 'sphinx.testing.fixtures'
6
8
7
9
8
10
@pytest .fixture (scope = 'session' )
9
11
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
+
10
17
return Path (__file__ ).resolve ().parent / 'roots'
Original file line number Diff line number Diff line change 1
1
"""Test the HTML Help builder and check output against XPath."""
2
2
3
3
import re
4
+ from pathlib import Path
4
5
5
6
import pytest
6
7
from html5lib import HTMLParser
@@ -55,7 +56,7 @@ def test_chm(app):
55
56
56
57
# check .hhk file
57
58
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' )
59
60
data = hhk_path .read_bytes ()
60
61
m = re .search (br'&#[xX][0-9a-fA-F]+;' , data )
61
62
assert m is None , 'Hex escaping exists in .hhk file: ' + str (m .group (0 ))
You can’t perform that action at this time.
0 commit comments