Skip to content

Commit

Permalink
馃敡 Fix sphinx deprecation warning (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Mar 26, 2024
1 parent 961a638 commit dfaf6d7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/test_sphinx/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def test_basic(app, status, warning, get_sphinx_app_output):
import pytest
from bs4 import BeautifulSoup
from docutils import nodes
from sphinx.testing.path import path

from myst_parser._compat import findall

Expand Down Expand Up @@ -67,15 +66,11 @@ def read(
regress_ext=".html",
replace=None,
):
outpath = path(os.path.join(str(app.srcdir), "_build", buildername, filename))
outpath = pathlib.Path(str(app.srcdir), "_build", buildername, filename)
if not outpath.exists():
raise OSError(f"no output file exists: {outpath}")

try:
# introduced in sphinx 3.0
content = outpath.read_text(encoding=encoding)
except AttributeError:
content = outpath.text(encoding=encoding)
content = outpath.read_text(encoding=encoding)

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

0 comments on commit dfaf6d7

Please sign in to comment.