Merge from master

This commit is contained in:
Jakob Lykke Andersen
2015-02-04 23:23:28 +01:00
206 changed files with 643 additions and 395 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
path
~~~~
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
+8 -8
View File
@@ -180,17 +180,17 @@ Tables
| 2 | Empty cells: | |
+----+----------------+----+
Table with multicol:
Table with multirow and multicol:
.. only:: latex
+----+---------------------+
| 1 | test! |
+----+---------+------+----+
| 2 | col | col | c |
| y +---------+------+----+
| x | test |
+----+---------------------+
+----+----------------+---------+
| 1 | test! | c |
+----+---------+------+ |
| 2 | col | col | |
| y +---------+------+----+----+
| x | multi-column cell | x |
+----+---------------------+----+
Figures
+1 -1
View File
@@ -6,7 +6,7 @@
This script runs the Sphinx unit test suite.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
+1 -1
View File
@@ -5,7 +5,7 @@
Test the Sphinx API for translator.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the sphinx.apidoc module.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the Sphinx class.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -6,7 +6,7 @@
Test the autodoc extension. This tests mainly the Documenters; the auto
directives are tested in a test source file translated by test_build.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test all builders.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the build process with gettext builder with the test root.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
+1 -1
View File
@@ -5,7 +5,7 @@
Test the HTML builder and check output against XPath.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the build process with LaTeX builder with the test root.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
+1 -1
View File
@@ -5,7 +5,7 @@
Test the build process with Texinfo builder with the test root.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
+1 -1
View File
@@ -5,7 +5,7 @@
Test the build process with Text builder with the test root.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the base build process.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import shutil
+1 -1
View File
@@ -6,7 +6,7 @@
Test the sphinx.config.Config class and its handling in the
Application class.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from six import PY2, PY3, StringIO
+1 -1
View File
@@ -5,7 +5,7 @@
Test the code-block directive.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the only directive with the test root.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test docutils.conf support for several writers.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+3 -1
View File
@@ -5,7 +5,7 @@
Tests the C++ Domain
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -63,6 +63,8 @@ def test_type_definitions():
check("type",
"public MyContainer::const_iterator",
"MyContainer::const_iterator")
# test decl specs on right
check("type", "bool const b")
check('member',
' const std::string & name = 42',
+1 -1
View File
@@ -5,7 +5,7 @@
Tests the Python Domain
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Tests the reStructuredText domain.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Tests the std domain
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+3 -4
View File
@@ -5,7 +5,7 @@
Test the BuildEnvironment class.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -106,13 +106,12 @@ def test_env_read_docs():
assert len(read_docnames) > 2 and read_docnames == sorted(read_docnames)
def on_env_read_docs_2(app, env, docnames):
docnames.reverse()
docnames.remove('images')
app.connect('env-before-read-docs', on_env_read_docs_2)
read_docnames = env.update(app.config, app.srcdir, app.doctreedir, app)
reversed_read_docnames = sorted(read_docnames, reverse=True)
assert len(read_docnames) > 2 and read_docnames == reversed_read_docnames
assert len(read_docnames) == 2
def test_object_inventory():
+1 -1
View File
@@ -5,7 +5,7 @@
Test the autosummary extension.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the coverage builder.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the doctest extension.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the intersphinx extension.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -6,7 +6,7 @@
Tests for :mod:`sphinx.ext.napoleon.__init__` module.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+45 -3
View File
@@ -6,7 +6,7 @@
Tests for :mod:`sphinx.ext.napoleon.docstring` module.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -155,6 +155,26 @@ class GoogleDocstringTest(BaseDocstringTest):
:returns: Extended
description of return value"""
), (
"""
Single line summary
Args:
arg1(str):Extended
description of arg1
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
""",
"""
Single line summary
:Parameters: * **arg1** (*str*) --
Extended
description of arg1
* **\\*args** --
Variable length argument list.
* **\\*\\*kwargs** --
Arbitrary keyword arguments."""
)]
def test_docstrings(self):
@@ -335,6 +355,28 @@ class NumpyDocstringTest(BaseDocstringTest):
:returns: *str* --
Extended
description of return value"""
), (
"""
Single line summary
Parameters
----------
arg1:str
Extended description of arg1
*args:
Variable length argument list.
**kwargs:
Arbitrary keyword arguments.
""",
"""
Single line summary
:Parameters: * **arg1** (*str*) --
Extended description of arg1
* ***args** --
Variable length argument list.
* ****kwargs** --
Arbitrary keyword arguments."""
)]
def test_docstrings(self):
@@ -362,7 +404,7 @@ param1 : :class:`MyClass <name.space.MyClass>` instance
config = Config(napoleon_use_param=True)
actual = str(NumpyDocstring(docstring, config))
expected = """\
:param param1:
:type param1: :class:`MyClass <name.space.MyClass>` instance
"""
self.assertEqual(expected, actual)
@@ -385,7 +427,7 @@ param1 : MyClass instance
config = Config(napoleon_use_param=True)
actual = str(NumpyDocstring(textwrap.dedent(docstring), config))
expected = """\
:param param1:
:type param1: MyClass instance
"""
self.assertEqual(expected, actual)
+1 -1
View File
@@ -6,7 +6,7 @@
Tests for :mod:`sphinx.ext.napoleon.iterators` module.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test sphinx.ext.viewcode extension.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+7 -1
View File
@@ -5,7 +5,7 @@
Test the Pygments highlighting bridge.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -62,6 +62,12 @@ def test_detect_interactive():
assert ret.startswith("<div class=\"highlight\">")
def test_lexer_options():
bridge = PygmentsBridge('html')
ret = bridge.highlight_block('//comment', 'php', opts={'startinline' : True})
assert '<span class="c1">//comment</span>' in ret
def test_set_formatter():
PygmentsBridge.html_formatter = MyFormatter
try:
+1 -1
View File
@@ -5,7 +5,7 @@
Test locale features.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -6,7 +6,7 @@
Test message patching for internationalization purposes. Runs the text
builder in the test root.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
+2 -2
View File
@@ -5,7 +5,7 @@
Test various Sphinx-specific markup extensions.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -136,7 +136,7 @@ def test_latex_escaping():
r'\(\Gamma\)\textbackslash{}\(\infty\)\$')
# in verbatim code fragments
yield (verify, u'::\n\n\\∞${}', None,
u'\\begin{Verbatim}[frame=single,commandchars=\\\\\\{\\}]\n'
u'\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n'
u'@\\(\\Gamma\\)\\PYGZbs{}\\(\\infty\\)\\PYGZdl{}\\PYGZob{}\\PYGZcb{}\n'
u'\\end{Verbatim}')
# in URIs
+1 -1
View File
@@ -5,7 +5,7 @@
Test our handling of metadata in files with bibliographic metadata.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the sphinx.quickstart module.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the search index builder.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the Web Support Package search adapters.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test setup_command for distutils.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test templating.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the Theme class.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test i18n util.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
+1 -1
View File
@@ -5,7 +5,7 @@
Tests uti.nodes functions.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from textwrap import dedent
+1 -1
View File
@@ -5,7 +5,7 @@
Test the versioning implementation.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -5,7 +5,7 @@
Test the Web Support Package
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+1 -1
View File
@@ -3,7 +3,7 @@
Sphinx test suite utilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""