Skip to content

Commit

Permalink
handle older sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Dec 5, 2023
1 parent 07453d6 commit 24e25bd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
from sphinx.addnodes import download_reference
from sphinx.errors import ExtensionError
from sphinx.testing.util import SphinxTestApp, assert_node
try:
from sphinx.testing.util import path
except ImportError:
path = None


from jupyter_sphinx.ast import (
JupyterCellNode,
Expand Down Expand Up @@ -47,6 +52,8 @@ def doctree(
(src_dir / "index.rst").write_text(source, encoding="utf8")

warnings = StringIO()
if path is not None:
src_dir = path(src_dir.as_posix())
app = SphinxTestApp(
srcdir=src_dir,
status=StringIO(),
Expand Down

0 comments on commit 24e25bd

Please sign in to comment.