Skip to content

Commit dfaf6d7

Browse files
authored
🔧 Fix sphinx deprecation warning (#895)
1 parent 961a638 commit dfaf6d7

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

tests/test_sphinx/conftest.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def test_basic(app, status, warning, get_sphinx_app_output):
3939
import pytest
4040
from bs4 import BeautifulSoup
4141
from docutils import nodes
42-
from sphinx.testing.path import path
4342

4443
from myst_parser._compat import findall
4544

@@ -67,15 +66,11 @@ def read(
6766
regress_ext=".html",
6867
replace=None,
6968
):
70-
outpath = path(os.path.join(str(app.srcdir), "_build", buildername, filename))
69+
outpath = pathlib.Path(str(app.srcdir), "_build", buildername, filename)
7170
if not outpath.exists():
7271
raise OSError(f"no output file exists: {outpath}")
7372

74-
try:
75-
# introduced in sphinx 3.0
76-
content = outpath.read_text(encoding=encoding)
77-
except AttributeError:
78-
content = outpath.text(encoding=encoding)
73+
content = outpath.read_text(encoding=encoding)
7974

8075
if regress_html:
8176
# only regress the inner body, since other sections are non-deterministic

0 commit comments

Comments
 (0)