From ac5aeaec15fd0d7603f68d983062c2ae23020f71 Mon Sep 17 00:00:00 2001 From: James Davies Date: Tue, 5 Oct 2021 16:14:10 -0400 Subject: [PATCH] Use pytest-doctestplus sphinx extension --- docs/conf.py | 4 ++-- setup.cfg | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index aa1edaebac..4942696c8f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,7 +35,7 @@ def setup(app): # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../')) +# sys.path.insert(0, os.path.abspath('../')) sys.path.insert(0, os.path.abspath('jwst/')) sys.path.insert(0, os.path.abspath('exts/')) @@ -82,6 +82,7 @@ def check_sphinx_version(expected_version): # ones. extensions = [ 'numfig', + 'pytest_doctestplus.sphinx.doctestplus', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', @@ -94,7 +95,6 @@ def check_sphinx_version(expected_version): 'sphinx_automodapi.automodsumm', 'sphinx_automodapi.autodoc_enhancements', 'sphinx_automodapi.smart_resolver', - 'sphinx_astropy.ext.doctest', 'sphinx_asdf', ] diff --git a/setup.cfg b/setup.cfg index e1c6509475..09e795ca09 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,7 +55,7 @@ docs = sphinx-automodapi sphinx-rtd-theme stsci-rtd-theme - sphinx-astropy + sphinx-astropy>=1.5 sphinx-asdf>=0.1.1 test = ci-watson>=0.3.0 @@ -120,8 +120,11 @@ ignore = minversion = 4.6 norecursedirs = docs/_build + docs/exts jwst/timeconversion + jwst/associations/tests/data scripts + .tox asdf_schema_tests_enabled = true asdf_schema_validate_default = false asdf_schema_root = jwst/transforms/schemas jwst/datamodels/schemas @@ -129,6 +132,8 @@ junit_family = xunit2 inputs_root = jwst-pipeline results_root = jwst-pipeline-results text_file_format = rst +doctest_plus = enabled +doctest_rst = enabled addopts = --show-capture=no --open-files --report-crds-context filterwarnings = ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning