added test for show_missing_items True

This commit is contained in:
Cielquan 2020-05-31 18:38:21 +02:00
parent d83f34794c
commit 42b755db2e
No known key found for this signature in database
GPG Key ID: FA3BA3BF51282609

View File

@ -28,6 +28,8 @@ def test_build(app, status, warning):
assert ' * mod -- No module named mod' # in the "failed import" section
assert "undocumented py" not in status.getvalue()
c_undoc = (app.outdir / 'c.txt').read_text()
assert c_undoc.startswith('Undocumented C API elements\n'
'===========================\n')
@ -46,6 +48,8 @@ def test_build(app, status, warning):
assert 'Class' in undoc_py['autodoc_target']['classes']
assert 'undocmeth' in undoc_py['autodoc_target']['classes']['Class']
assert "undocumented c" not in status.getvalue()
@pytest.mark.sphinx('coverage', testroot='ext-coverage')
def test_coverage_ignore_pyobjects(app, status, warning):
@ -64,3 +68,16 @@ Classes:
'''
assert actual == expected
@pytest.mark.sphinx('coverage', confoverrides={'coverage_show_missing_items': True})
def test_show_missing_items(app, status, warning):
app.builder.build_all()
assert "undocumented" in status.getvalue()
assert "py function raises" in status.getvalue()
assert "py class Base" in status.getvalue()
assert "py method Class.roger" in status.getvalue()
assert "c api Py_SphinxTest [ function]" in status.getvalue()