mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6061 from tk0miya/reduce_warnings_of_rootcase
test: Reduce warnings on building test-root
This commit is contained in:
commit
cd542fb2af
@ -3,8 +3,6 @@ Autodoc tests
|
||||
|
||||
Just testing a few autodoc possibilities...
|
||||
|
||||
.. automodule:: util
|
||||
|
||||
.. automodule:: autodoc_target
|
||||
:members:
|
||||
|
||||
@ -28,12 +26,6 @@ Just testing a few autodoc possibilities...
|
||||
:members:
|
||||
|
||||
|
||||
.. automodule:: autodoc_fodder
|
||||
:noindex:
|
||||
|
||||
.. autoclass:: MarkupError
|
||||
|
||||
|
||||
.. currentmodule:: autodoc_target
|
||||
|
||||
.. autoclass:: InstAttCls
|
||||
|
@ -1,7 +0,0 @@
|
||||
|
||||
class MarkupError(object):
|
||||
"""
|
||||
.. note:: This is a docstring with a
|
||||
small markup error which should have
|
||||
correct location information.
|
||||
"""
|
@ -4,9 +4,6 @@ Sphinx image handling
|
||||
.. first, a simple test with direct filename
|
||||
.. image:: img.png
|
||||
|
||||
.. a non-existing image with direct filename
|
||||
.. image:: foo.png
|
||||
|
||||
.. an image with path name (relative to this directory!)
|
||||
.. image:: subdir/img.png
|
||||
:height: 100
|
||||
|
@ -3,7 +3,6 @@ Testing downloadable files
|
||||
|
||||
Download :download:`img.png` here.
|
||||
Download :download:`this <subdir/img.png>` there.
|
||||
Don't download :download:`this <nonexisting.png>`.
|
||||
|
||||
Test file and literal inclusion
|
||||
===============================
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
.. Paths in included files are relative to the file that
|
||||
includes them
|
||||
.. image:: ../root/img.png
|
||||
.. image:: subdir/img.png
|
||||
|
@ -10,11 +10,12 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy', srcdir="test_builder")
|
||||
@pytest.mark.sphinx('dummy', srcdir="test_builder", freshenv=True)
|
||||
def test_incremental_reading(app):
|
||||
# first reading
|
||||
updated = app.builder.read()
|
||||
assert set(updated) == app.env.found_docs == set(app.env.all_docs)
|
||||
assert updated == sorted(updated) # sorted by alphanumeric
|
||||
|
||||
# test if exclude_patterns works ok
|
||||
assert 'subdir/excluded' not in app.env.found_docs
|
||||
@ -27,29 +28,20 @@ def test_incremental_reading(app):
|
||||
# second reading
|
||||
updated = app.builder.read()
|
||||
|
||||
# "includes" and "images" are in there because they contain references
|
||||
# to nonexisting downloadable or image files, which are given another
|
||||
# chance to exist
|
||||
assert set(updated) == set(['index', 'new', 'includes', 'images'])
|
||||
assert set(updated) == set(['index', 'new'])
|
||||
assert 'autodoc' not in app.env.all_docs
|
||||
assert 'autodoc' not in app.env.found_docs
|
||||
|
||||
|
||||
@pytest.mark.sphinx('dummy')
|
||||
def test_env_read_docs(app):
|
||||
"""By default, docnames are read in alphanumeric order"""
|
||||
def on_env_read_docs_1(app, env, docnames):
|
||||
pass
|
||||
@pytest.mark.sphinx('dummy', testroot='warnings', freshenv=True)
|
||||
def test_incremental_reading_for_missing_files(app):
|
||||
# first reading
|
||||
updated = app.builder.read()
|
||||
assert set(updated) == app.env.found_docs == set(app.env.all_docs)
|
||||
|
||||
app.connect('env-before-read-docs', on_env_read_docs_1)
|
||||
# second reading
|
||||
updated = app.builder.read()
|
||||
|
||||
read_docnames = app.builder.read()
|
||||
assert len(read_docnames) > 2 and read_docnames == sorted(read_docnames)
|
||||
|
||||
def on_env_read_docs_2(app, env, docnames):
|
||||
docnames.remove('images')
|
||||
|
||||
app.connect('env-before-read-docs', on_env_read_docs_2)
|
||||
|
||||
read_docnames = app.builder.read()
|
||||
assert len(read_docnames) == 2
|
||||
# "index" is listed up to updated because it contains references
|
||||
# to nonexisting downloadable or image files
|
||||
assert set(updated) == set(['index'])
|
||||
|
@ -17,8 +17,6 @@ from sphinx.testing.comparer import PathComparer
|
||||
@pytest.mark.sphinx('dummy')
|
||||
def test_images(app):
|
||||
app.build()
|
||||
assert ('image file not readable: foo.png'
|
||||
in app._warning.getvalue())
|
||||
|
||||
tree = app.env.get_doctree('images')
|
||||
htmlbuilder = StandaloneHTMLBuilder(app)
|
||||
|
@ -49,7 +49,6 @@ def apidoc_params(request):
|
||||
def test_simple(make_app, apidoc):
|
||||
outdir = apidoc.outdir
|
||||
assert (outdir / 'conf.py').isfile()
|
||||
assert (outdir / 'autodoc_fodder.rst').isfile()
|
||||
assert (outdir / 'index.rst').isfile()
|
||||
|
||||
app = make_app('text', srcdir=outdir)
|
||||
@ -273,7 +272,6 @@ def test_excludes_module_should_not_be_skipped(apidoc):
|
||||
def test_multibyte_parameters(make_app, apidoc):
|
||||
outdir = apidoc.outdir
|
||||
assert (outdir / 'conf.py').isfile()
|
||||
assert (outdir / 'autodoc_fodder.rst').isfile()
|
||||
assert (outdir / 'index.rst').isfile()
|
||||
|
||||
conf_py = (outdir / 'conf.py').text()
|
||||
|
Loading…
Reference in New Issue
Block a user