mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add ext.autodoc + ext.doctest test root
This commit is contained in:
parent
c2cd4f6a40
commit
973f2680d6
1
AUTHORS
1
AUTHORS
@ -34,6 +34,7 @@ Other contributors, listed alphabetically, are:
|
|||||||
* Hernan Grecco -- search improvements
|
* Hernan Grecco -- search improvements
|
||||||
* Horst Gutmann -- internationalization support
|
* Horst Gutmann -- internationalization support
|
||||||
* Martin Hans -- autodoc improvements
|
* Martin Hans -- autodoc improvements
|
||||||
|
* Zac Hatfield-Dodds -- doctest reporting improvements
|
||||||
* Doug Hellmann -- graphviz improvements
|
* Doug Hellmann -- graphviz improvements
|
||||||
* Tim Hoffmann -- theme improvements
|
* Tim Hoffmann -- theme improvements
|
||||||
* Timotheus Kampik - JS theme & search enhancements
|
* Timotheus Kampik - JS theme & search enhancements
|
||||||
|
5
CHANGES
5
CHANGES
@ -20,6 +20,7 @@ Bugs fixed
|
|||||||
* #4531: autosummary: methods are not treated as attributes
|
* #4531: autosummary: methods are not treated as attributes
|
||||||
* #4538: autodoc: ``sphinx.ext.autodoc.Options`` has been moved
|
* #4538: autodoc: ``sphinx.ext.autodoc.Options`` has been moved
|
||||||
* #4539: autodoc emits warnings for partialmethods
|
* #4539: autodoc emits warnings for partialmethods
|
||||||
|
* #4223: doctest: failing tests reported in wrong file, at wrong line
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
@ -190,7 +191,7 @@ Bugs fixed
|
|||||||
* #3962: sphinx-apidoc does not recognize implicit namespace packages correctly
|
* #3962: sphinx-apidoc does not recognize implicit namespace packages correctly
|
||||||
* #4094: C++, allow empty template argument lists.
|
* #4094: C++, allow empty template argument lists.
|
||||||
* C++, also hyperlink types in the name of declarations with qualified names.
|
* C++, also hyperlink types in the name of declarations with qualified names.
|
||||||
* C++, do not add index entries for declarations inside concepts.
|
* C++, do not add index entries for declarations inside concepts.
|
||||||
* C++, support the template disambiguator for dependent names.
|
* C++, support the template disambiguator for dependent names.
|
||||||
* #4314: For PDF 'howto' documents, numbering of code-blocks differs from the
|
* #4314: For PDF 'howto' documents, numbering of code-blocks differs from the
|
||||||
one of figures and tables
|
one of figures and tables
|
||||||
@ -284,7 +285,7 @@ Bugs fixed
|
|||||||
* #1421: Respect the quiet flag in sphinx-quickstart
|
* #1421: Respect the quiet flag in sphinx-quickstart
|
||||||
* #4281: Race conditions when creating output directory
|
* #4281: Race conditions when creating output directory
|
||||||
* #4315: For PDF 'howto' documents, ``latex_toplevel_sectioning='part'`` generates
|
* #4315: For PDF 'howto' documents, ``latex_toplevel_sectioning='part'`` generates
|
||||||
``\chapter`` commands
|
``\chapter`` commands
|
||||||
* #4214: Two todolist directives break sphinx-1.6.5
|
* #4214: Two todolist directives break sphinx-1.6.5
|
||||||
* Fix links to external option docs with intersphinx (refs: #3769)
|
* Fix links to external option docs with intersphinx (refs: #3769)
|
||||||
* #4091: Private members not documented without :undoc-members:
|
* #4091: Private members not documented without :undoc-members:
|
||||||
|
8
tests/roots/test-ext-doctest-with-autodoc/conf.py
Normal file
8
tests/roots/test-ext-doctest-with-autodoc/conf.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from os import path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.insert(0, path.abspath(path.dirname(__file__)))
|
||||||
|
|
||||||
|
project = 'test project for doctest + autodoc reporting'
|
||||||
|
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
|
||||||
|
master_doc = 'index'
|
4
tests/roots/test-ext-doctest-with-autodoc/dir/bar.py
Normal file
4
tests/roots/test-ext-doctest-with-autodoc/dir/bar.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
"""
|
||||||
|
>>> 'dir/bar.py:2'
|
||||||
|
|
||||||
|
"""
|
4
tests/roots/test-ext-doctest-with-autodoc/dir/inner.rst
Normal file
4
tests/roots/test-ext-doctest-with-autodoc/dir/inner.rst
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
>>> 'dir/inner.rst:1'
|
||||||
|
|
||||||
|
.. automodule:: dir.bar
|
||||||
|
:members:
|
5
tests/roots/test-ext-doctest-with-autodoc/foo.py
Normal file
5
tests/roots/test-ext-doctest-with-autodoc/foo.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"""
|
||||||
|
|
||||||
|
>>> 'foo.py:3'
|
||||||
|
|
||||||
|
"""
|
4
tests/roots/test-ext-doctest-with-autodoc/index.rst
Normal file
4
tests/roots/test-ext-doctest-with-autodoc/index.rst
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.. automodule:: foo
|
||||||
|
:members:
|
||||||
|
|
||||||
|
>>> 'index.rst:4'
|
@ -55,3 +55,21 @@ def test_is_allowed_version():
|
|||||||
def cleanup_call():
|
def cleanup_call():
|
||||||
global cleanup_called
|
global cleanup_called
|
||||||
cleanup_called += 1
|
cleanup_called += 1
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.sphinx('doctest', testroot='ext-doctest-with-autodoc')
|
||||||
|
def test_reporting_with_autodoc(app, status, warning, capfd):
|
||||||
|
# Patch builder to get a copy of the output
|
||||||
|
written = []
|
||||||
|
app.builder._warn_out = written.append
|
||||||
|
app.builder.build_all()
|
||||||
|
lines = '\n'.join(written).split('\n')
|
||||||
|
failures = [l for l in lines if l.startswith('File')]
|
||||||
|
expected = [
|
||||||
|
'File "dir/inner.rst", line 1, in default',
|
||||||
|
'File "dir/bar.py", line 2, in default',
|
||||||
|
'File "foo.py", line 3, in default',
|
||||||
|
'File "index.rst", line 4, in default',
|
||||||
|
]
|
||||||
|
for location in expected:
|
||||||
|
assert location in failures
|
||||||
|
Loading…
Reference in New Issue
Block a user