Skip to content

Commit de048db

Browse files
committed
Deprecating the usage of sphinx_astropy.ext.doctest in the config in favour pytest-doctestplus
1 parent 638aa0b commit de048db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sphinx_astropy/conf/v1.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,21 @@ def check_sphinx_version(expected_version):
210210
'numpydoc',
211211
'sphinx_automodapi.automodapi',
212212
'sphinx_automodapi.smart_resolver',
213-
'sphinx_astropy.ext.doctest',
214213
'sphinx_astropy.ext.changelog_links',
215214
'sphinx_astropy.ext.generate_config',
216215
'sphinx_astropy.ext.missing_static',
217216
'sphinx.ext.mathjax']
218217

218+
try:
219+
# Do this while in deprecation
220+
import pytest_doctestplus.sphinx.doctestplus
221+
extensions += ['pytest_doctestplus.sphinx.doctestplus']
222+
except ImportError:
223+
warnings.warn("sphinx_astropy.ext.doctest has been deprecated "
224+
"use the doctestplus extensions from pytest-doctestplus: "
225+
"pytest_doctestplus.sphinx.doctestplus.",DeprecationWarning)
226+
extensions += ['sphinx_astropy.ext.doctest']
227+
219228
try:
220229
import matplotlib.sphinxext.plot_directive
221230
extensions += [matplotlib.sphinxext.plot_directive.__name__]

0 commit comments

Comments
 (0)