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...
|
Just testing a few autodoc possibilities...
|
||||||
|
|
||||||
.. automodule:: util
|
|
||||||
|
|
||||||
.. automodule:: autodoc_target
|
.. automodule:: autodoc_target
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
@ -28,12 +26,6 @@ Just testing a few autodoc possibilities...
|
|||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
.. automodule:: autodoc_fodder
|
|
||||||
:noindex:
|
|
||||||
|
|
||||||
.. autoclass:: MarkupError
|
|
||||||
|
|
||||||
|
|
||||||
.. currentmodule:: autodoc_target
|
.. currentmodule:: autodoc_target
|
||||||
|
|
||||||
.. autoclass:: InstAttCls
|
.. 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
|
.. first, a simple test with direct filename
|
||||||
.. image:: img.png
|
.. image:: img.png
|
||||||
|
|
||||||
.. a non-existing image with direct filename
|
|
||||||
.. image:: foo.png
|
|
||||||
|
|
||||||
.. an image with path name (relative to this directory!)
|
.. an image with path name (relative to this directory!)
|
||||||
.. image:: subdir/img.png
|
.. image:: subdir/img.png
|
||||||
:height: 100
|
:height: 100
|
||||||
|
@ -3,7 +3,6 @@ Testing downloadable files
|
|||||||
|
|
||||||
Download :download:`img.png` here.
|
Download :download:`img.png` here.
|
||||||
Download :download:`this <subdir/img.png>` there.
|
Download :download:`this <subdir/img.png>` there.
|
||||||
Don't download :download:`this <nonexisting.png>`.
|
|
||||||
|
|
||||||
Test file and literal inclusion
|
Test file and literal inclusion
|
||||||
===============================
|
===============================
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
.. Paths in included files are relative to the file that
|
.. Paths in included files are relative to the file that
|
||||||
includes them
|
includes them
|
||||||
.. image:: ../root/img.png
|
.. image:: subdir/img.png
|
||||||
|
@ -10,11 +10,12 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('dummy', srcdir="test_builder")
|
@pytest.mark.sphinx('dummy', srcdir="test_builder", freshenv=True)
|
||||||
def test_incremental_reading(app):
|
def test_incremental_reading(app):
|
||||||
# first reading
|
# first reading
|
||||||
updated = app.builder.read()
|
updated = app.builder.read()
|
||||||
assert set(updated) == app.env.found_docs == set(app.env.all_docs)
|
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
|
# test if exclude_patterns works ok
|
||||||
assert 'subdir/excluded' not in app.env.found_docs
|
assert 'subdir/excluded' not in app.env.found_docs
|
||||||
@ -27,29 +28,20 @@ def test_incremental_reading(app):
|
|||||||
# second reading
|
# second reading
|
||||||
updated = app.builder.read()
|
updated = app.builder.read()
|
||||||
|
|
||||||
# "includes" and "images" are in there because they contain references
|
assert set(updated) == set(['index', 'new'])
|
||||||
# to nonexisting downloadable or image files, which are given another
|
|
||||||
# chance to exist
|
|
||||||
assert set(updated) == set(['index', 'new', 'includes', 'images'])
|
|
||||||
assert 'autodoc' not in app.env.all_docs
|
assert 'autodoc' not in app.env.all_docs
|
||||||
assert 'autodoc' not in app.env.found_docs
|
assert 'autodoc' not in app.env.found_docs
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('dummy')
|
@pytest.mark.sphinx('dummy', testroot='warnings', freshenv=True)
|
||||||
def test_env_read_docs(app):
|
def test_incremental_reading_for_missing_files(app):
|
||||||
"""By default, docnames are read in alphanumeric order"""
|
# first reading
|
||||||
def on_env_read_docs_1(app, env, docnames):
|
updated = app.builder.read()
|
||||||
pass
|
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()
|
# "index" is listed up to updated because it contains references
|
||||||
assert len(read_docnames) > 2 and read_docnames == sorted(read_docnames)
|
# to nonexisting downloadable or image files
|
||||||
|
assert set(updated) == set(['index'])
|
||||||
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
|
|
||||||
|
@ -17,8 +17,6 @@ from sphinx.testing.comparer import PathComparer
|
|||||||
@pytest.mark.sphinx('dummy')
|
@pytest.mark.sphinx('dummy')
|
||||||
def test_images(app):
|
def test_images(app):
|
||||||
app.build()
|
app.build()
|
||||||
assert ('image file not readable: foo.png'
|
|
||||||
in app._warning.getvalue())
|
|
||||||
|
|
||||||
tree = app.env.get_doctree('images')
|
tree = app.env.get_doctree('images')
|
||||||
htmlbuilder = StandaloneHTMLBuilder(app)
|
htmlbuilder = StandaloneHTMLBuilder(app)
|
||||||
|
@ -49,7 +49,6 @@ def apidoc_params(request):
|
|||||||
def test_simple(make_app, apidoc):
|
def test_simple(make_app, apidoc):
|
||||||
outdir = apidoc.outdir
|
outdir = apidoc.outdir
|
||||||
assert (outdir / 'conf.py').isfile()
|
assert (outdir / 'conf.py').isfile()
|
||||||
assert (outdir / 'autodoc_fodder.rst').isfile()
|
|
||||||
assert (outdir / 'index.rst').isfile()
|
assert (outdir / 'index.rst').isfile()
|
||||||
|
|
||||||
app = make_app('text', srcdir=outdir)
|
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):
|
def test_multibyte_parameters(make_app, apidoc):
|
||||||
outdir = apidoc.outdir
|
outdir = apidoc.outdir
|
||||||
assert (outdir / 'conf.py').isfile()
|
assert (outdir / 'conf.py').isfile()
|
||||||
assert (outdir / 'autodoc_fodder.rst').isfile()
|
|
||||||
assert (outdir / 'index.rst').isfile()
|
assert (outdir / 'index.rst').isfile()
|
||||||
|
|
||||||
conf_py = (outdir / 'conf.py').text()
|
conf_py = (outdir / 'conf.py').text()
|
||||||
|
Loading…
Reference in New Issue
Block a user