add doctest by default

This commit is contained in:
Jason Carver 2018-02-07 11:14:11 -08:00
parent beb1b10ee8
commit a9d9fec258
3 changed files with 22 additions and 2 deletions

View File

@ -38,6 +38,7 @@ build-docs:
sphinx-apidoc -o docs/ . setup.py "*conftest*" sphinx-apidoc -o docs/ . setup.py "*conftest*"
$(MAKE) -C docs clean $(MAKE) -C docs clean
$(MAKE) -C docs html $(MAKE) -C docs html
$(MAKE) -C docs doctest
docs: build-docs docs: build-docs
open docs/_build/html/index.html open docs/_build/html/index.html

View File

@ -34,7 +34,11 @@ with open (os.path.join(DIR, '../setup.py'), 'r') as f:
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@ -271,3 +275,14 @@ texinfo_documents = [
intersphinx_mapping = { intersphinx_mapping = {
'python': ('https://docs.python.org/3.5', None), 'python': ('https://docs.python.org/3.5', None),
} }
# -- Doctest configuration ----------------------------------------
import doctest
doctest_default_flags = (0
| doctest.DONT_ACCEPT_TRUE_FOR_1
| doctest.ELLIPSIS
| doctest.IGNORE_EXCEPTION_DETAIL
| doctest.NORMALIZE_WHITESPACE
)

View File

@ -2,6 +2,7 @@
envlist= envlist=
py{35,36,py3}-core py{35,36,py3}-core
lint lint
doctest
[isort] [isort]
combine_as_imports=True combine_as_imports=True
@ -22,11 +23,14 @@ ignore=
usedevelop=True usedevelop=True
commands= commands=
core: py.test {posargs:tests/core} core: py.test {posargs:tests/core}
doctest: make -C {toxinidir}/docs doctest
basepython = basepython =
py35: python3.5 py35: python3.5
py36: python3.6 py36: python3.6
pypy3: pypy3 pypy3: pypy3
extras=test extras=
test
doctest: doc
[testenv:lint] [testenv:lint]
basepython=python basepython=python