Merge branch 'stable'

This commit is contained in:
Takeshi KOMIYA
2017-01-29 18:05:17 +09:00
29 changed files with 140 additions and 86 deletions

View File

@@ -75,9 +75,15 @@ Deprecated
Features added
--------------
* Support requests-2.0.0 (experimental) (refs: #3367)
Bugs fixed
----------
* #3370: the caption of code-block is not picked up for translation
* LaTeX: :confval:`release` is not escaped (refs: #3362)
* #3364: sphinx-quickstart prompts overflow on Console with 80 chars width
Testing
--------

View File

@@ -26,4 +26,4 @@ universal = 1
[flake8]
max-line-length = 95
ignore = E116,E241,E251
exclude = .git,.tox,tests/*,build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py
exclude = .git,.tox,tests/*,build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py

View File

@@ -50,7 +50,7 @@ requires = [
'babel>=1.3,!=2.0',
'alabaster>=0.7,<0.8',
'imagesize',
'requests>=2.4.0',
'requests>=2.0.0',
'typing',
]
extras_require = {

View File

@@ -81,8 +81,8 @@ def container_wrapper(directive, literal_node, caption):
raise ValueError(parsed[0])
caption_node = nodes.caption(parsed[0].rawsource, '',
*parsed[0].children)
caption_node.source = parsed[0].source
caption_node.line = parsed[0].line
caption_node.source = literal_node.source
caption_node.line = literal_node.line
container_node += caption_node
container_node += literal_node
return container_node

View File

@@ -44,9 +44,6 @@ from sphinx.util import texescape
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
# function to get input from terminal -- overridden by the test suite
term_input = input
DEFAULT_VALUE = {
'path': '.',
'sep': False,
@@ -74,6 +71,12 @@ def mkdir_p(dir):
os.makedirs(dir)
# function to get input from terminal -- overridden by the test suite
def term_input(prompt):
sys.stdout.write(prompt)
return input('')
class ValidationError(Exception):
"""Raised for validation errors."""

View File

@@ -11,18 +11,30 @@
from __future__ import absolute_import
import requests
import warnings
from contextlib import contextmanager
import requests
import pkg_resources
from six import string_types
from six.moves.urllib.parse import urlsplit
try:
from requests.packages.urllib3.exceptions import SSLError, InsecureRequestWarning
from requests.packages.urllib3.exceptions import SSLError
except ImportError:
# python-requests package in Debian jessie does not provide ``requests.packages.urllib3``.
# So try to import the exceptions from urllib3 package.
from urllib3.exceptions import SSLError, InsecureRequestWarning # type: ignore
from urllib3.exceptions import SSLError # type: ignore
try:
from requests.packages.urllib3.exceptions import InsecureRequestWarning
except ImportError:
try:
# for Debian-jessie
from urllib3.exceptions import InsecureRequestWarning # type: ignore
except ImportError:
# for requests < 2.4.0
InsecureRequestWarning = None
# try to load requests[security]
try:
@@ -65,6 +77,15 @@ def is_ssl_error(exc):
return False
@contextmanager
def ignore_insecure_warning(**kwargs):
with warnings.catch_warnings():
if not kwargs.get('verify') and InsecureRequestWarning:
# ignore InsecureRequestWarning if verify=False
warnings.filterwarnings("ignore", category=InsecureRequestWarning)
yield
def _get_tls_cacert(url, config):
"""Get addiotinal CA cert for a specific URL.
@@ -96,10 +117,7 @@ def get(url, **kwargs):
if config:
kwargs.setdefault('verify', _get_tls_cacert(url, config))
with warnings.catch_warnings():
if not kwargs.get('verify'):
# ignore InsecureRequestWarning if verify=False
warnings.filterwarnings("ignore", category=InsecureRequestWarning)
with ignore_insecure_warning(**kwargs):
return requests.get(url, **kwargs)
@@ -112,8 +130,5 @@ def head(url, **kwargs):
if config:
kwargs.setdefault('verify', _get_tls_cacert(url, config))
with warnings.catch_warnings():
if not kwargs.get('verify'):
# ignore InsecureRequestWarning if verify=False
warnings.filterwarnings("ignore", category=InsecureRequestWarning)
with ignore_insecure_warning(**kwargs):
return requests.get(url, **kwargs)

View File

@@ -408,9 +408,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.elements.update({
'wrapperclass': self.format_docclass(document.settings.docclass),
# if empty, the title is set to the first section title
'title': document.settings.title,
'release': builder.config.release,
'author': document.settings.author,
'title': document.settings.title, # treat as a raw LaTeX code
'release': self.encode(builder.config.release),
'author': document.settings.author, # treat as a raw LaTeX code
'releasename': _('Release'),
'indexname': _('Index'),
})

View File

@@ -28,6 +28,9 @@ msgstr "MISSING LITERAL BLOCK::"
msgid "That's all."
msgstr "THAT'S ALL."
msgid "included raw.txt"
msgstr "INCLUDED RAW.TXT"
msgid "code blocks"
msgstr "CODE-BLOCKS"
@@ -40,6 +43,9 @@ msgstr ""
" 'RESULT'\n"
"end"
msgid "example of C language"
msgstr "EXAMPLE OF C LANGUAGE"
msgid ""
"#include <stdlib.h>\n"
"int main(int argc, char** argv)\n"

View File

@@ -12,6 +12,9 @@ Missing literal block::
That's all.
.. literalinclude:: raw.txt
:caption: included raw.txt
code blocks
==============
@@ -32,6 +35,7 @@ code blocks
}
.. code-block:: c
:caption: example of C language
#include <stdio.h>
int main(int argc, char** argv)

View File

@@ -59,8 +59,8 @@ ignore_paths = [
for sub in ('root', 'roots')
]
args = sys.argv[1:]
for path in ignore_paths:
args.extend(['--ignore', path])
for ignore_path in ignore_paths:
args.extend(['--ignore', ignore_path])
import pytest
import pytest # NOQA
sys.exit(pytest.main(args))

View File

@@ -871,6 +871,7 @@ def test_generate():
assert_result_contains('.. py:function:: decoratedFunction()',
'module', 'autodoc_missing_imports')
# --- generate fodder ------------
__all__ = ['Class']
@@ -909,6 +910,7 @@ class CustomDataDescriptor(object):
class CustomDataDescriptorMeta(type):
"""Descriptor metaclass docstring."""
@add_metaclass(CustomDataDescriptorMeta)
class CustomDataDescriptor2(CustomDataDescriptor):
"""Descriptor class with custom metaclass docstring."""

View File

@@ -46,11 +46,10 @@ def nonascii_srcdir(request):
master_doc = srcdir / 'contents.txt'
master_doc.write_text(master_doc.text() + dedent(u"""
.. toctree::
.. toctree::
%(test_name)s/%(test_name)s
""" % {'test_name': test_name})
)
%(test_name)s/%(test_name)s
""" % {'test_name': test_name}))
return srcdir

View File

@@ -52,6 +52,7 @@ if PY3:
etree_cache = {}
@pytest.fixture(scope='module')
def cached_etree_parse():
def parse(fname):

View File

@@ -171,7 +171,7 @@ def test_latex_title_after_admonitions(app, status, warning):
@pytest.mark.sphinx('latex', testroot='numfig',
confoverrides={'numfig': True})
confoverrides={'numfig': True})
def test_numref(app, status, warning):
app.builder.build_all()
result = (app.outdir / 'Python.tex').text(encoding='utf8')
@@ -548,12 +548,12 @@ def test_latex_show_urls_is_inline(app, status, warning):
'{\\hyperref[\\detokenize{index:the-section-with-a-reference-to}]'
'{\\sphinxcrossref{The section with a reference to }}}' in result)
assert ('First footnote: %\n\\begin{footnote}[2]\\sphinxAtStartFootnote\n'
'First\n%\n\\end{footnote}') in result
'First\n%\n\\end{footnote}') in result
assert ('Second footnote: %\n\\begin{footnote}[1]\\sphinxAtStartFootnote\n'
'Second\n%\n\\end{footnote}') in result
'Second\n%\n\\end{footnote}') in result
assert '\\href{http://sphinx-doc.org/}{Sphinx} (http://sphinx-doc.org/)' in result
assert ('Third footnote: %\n\\begin{footnote}[3]\\sphinxAtStartFootnote\n'
'Third\n%\n\\end{footnote}') in result
'Third\n%\n\\end{footnote}') in result
assert ('\\href{http://sphinx-doc.org/~test/}{URL including tilde} '
'(http://sphinx-doc.org/\\textasciitilde{}test/)') in result
assert ('\\item[{\\href{http://sphinx-doc.org/}{URL in term} '
@@ -591,9 +591,9 @@ def test_latex_show_urls_is_footnote(app, status, warning):
'{\\hyperref[\\detokenize{index:the-section-with-a-reference-to}]'
'{\\sphinxcrossref{The section with a reference to }}}') in result
assert ('First footnote: %\n\\begin{footnote}[3]\\sphinxAtStartFootnote\n'
'First\n%\n\\end{footnote}') in result
'First\n%\n\\end{footnote}') in result
assert ('Second footnote: %\n\\begin{footnote}[1]\\sphinxAtStartFootnote\n'
'Second\n%\n\\end{footnote}') in result
'Second\n%\n\\end{footnote}') in result
assert ('\\href{http://sphinx-doc.org/}{Sphinx}'
'%\n\\begin{footnote}[4]\\sphinxAtStartFootnote\n'
'\\nolinkurl{http://sphinx-doc.org/}\n%\n\\end{footnote}') in result
@@ -615,7 +615,7 @@ def test_latex_show_urls_is_footnote(app, status, warning):
'\\leavevmode%\n\\begin{footnotetext}[9]\\sphinxAtStartFootnote\n'
'\\nolinkurl{http://sphinx-doc.org/}\n%\n'
'\\end{footnotetext}\nDescription') in result
assert '\\url{https://github.com/sphinx-doc/sphinx}\n' in result
assert ('\\url{https://github.com/sphinx-doc/sphinx}\n' in result)
assert ('\\href{mailto:sphinx-dev@googlegroups.com}'
'{sphinx-dev@googlegroups.com}\n') in result
@@ -643,12 +643,12 @@ def test_latex_show_urls_is_no(app, status, warning):
'{\\hyperref[\\detokenize{index:the-section-with-a-reference-to}]'
'{\\sphinxcrossref{The section with a reference to }}}' in result)
assert ('First footnote: %\n\\begin{footnote}[2]\\sphinxAtStartFootnote\n'
'First\n%\n\\end{footnote}') in result
'First\n%\n\\end{footnote}') in result
assert ('Second footnote: %\n\\begin{footnote}[1]\\sphinxAtStartFootnote\n'
'Second\n%\n\\end{footnote}') in result
'Second\n%\n\\end{footnote}') in result
assert '\\href{http://sphinx-doc.org/}{Sphinx}' in result
assert ('Third footnote: %\n\\begin{footnote}[3]\\sphinxAtStartFootnote\n'
'Third\n%\n\\end{footnote}') in result
'Third\n%\n\\end{footnote}') in result
assert '\\href{http://sphinx-doc.org/~test/}{URL including tilde}' in result
assert ('\\item[{\\href{http://sphinx-doc.org/}{URL in term}}] '
'\\leavevmode\nDescription') in result
@@ -688,10 +688,10 @@ def test_latex_logo_if_not_found(app, status, warning):
@pytest.mark.sphinx('latex', testroot='toctree-maxdepth',
confoverrides={'latex_documents': [
('index', 'SphinxTests.tex', 'Sphinx Tests Documentation',
'Georg Brandl', 'manual'),
]})
confoverrides={'latex_documents': [
('index', 'SphinxTests.tex', 'Sphinx Tests Documentation',
'Georg Brandl', 'manual'),
]})
def test_toctree_maxdepth_manual(app, status, warning):
app.builder.build_all()
result = (app.outdir / 'SphinxTests.tex').text(encoding='utf8')
@@ -804,6 +804,7 @@ def test_latex_toplevel_sectioning_is_section(app, status, warning):
print(warning.getvalue())
assert '\\section{Foo}' in result
@skip_if_stylefiles_notfound
@pytest.mark.sphinx('latex', testroot='maxlistdepth')
def test_maxlistdepth_at_ten(app, status, warning):

View File

@@ -169,8 +169,8 @@ def test_config_eol(logger, tempdir):
@pytest.mark.sphinx(confoverrides={'master_doc': 123,
'language': 'foo',
'primary_domain': None})
'language': 'foo',
'primary_domain': None})
def test_builtin_conf(app, status, warning):
warnings = warning.getvalue()
assert 'master_doc' in warnings, (

View File

@@ -67,8 +67,8 @@ def test_code_block_caption_latex(app, status, warning):
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
caption = '\\sphinxSetupCaptionForVerbatim{caption \\sphinxstyleemphasis{test} rb}'
label = '\\def\\sphinxLiteralBlockLabel{\\label{\\detokenize{caption:id1}}}'
link = '\hyperref[\\detokenize{caption:name-test-rb}]' \
'{Listing \\ref{\\detokenize{caption:name-test-rb}}}'
link = '\hyperref[\\detokenize{caption:name-test-rb}]' \
'{Listing \\ref{\\detokenize{caption:name-test-rb}}}'
assert caption in latex
assert label in latex
assert link in latex
@@ -79,12 +79,12 @@ def test_code_block_namedlink_latex(app, status, warning):
app.builder.build_all()
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
label1 = '\\def\\sphinxLiteralBlockLabel{\\label{\\detokenize{caption:name-test-rb}}}'
link1 = '\\hyperref[\\detokenize{caption:name-test-rb}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{Ruby}}'
link1 = '\\hyperref[\\detokenize{caption:name-test-rb}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{Ruby}}'
label2 = ('\\def\\sphinxLiteralBlockLabel'
'{\\label{\\detokenize{namedblocks:some-ruby-code}}}')
link2 = '\\hyperref[\\detokenize{namedblocks:some-ruby-code}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{the ruby code}}}'
link2 = '\\hyperref[\\detokenize{namedblocks:some-ruby-code}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{the ruby code}}}'
assert label1 in latex
assert link1 in latex
assert label2 in latex
@@ -263,8 +263,8 @@ def test_literalinclude_caption_latex(app, status, warning):
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
caption = '\\sphinxSetupCaptionForVerbatim{caption \\sphinxstylestrong{test} py}'
label = '\\def\\sphinxLiteralBlockLabel{\\label{\\detokenize{caption:id2}}}'
link = '\hyperref[\\detokenize{caption:name-test-py}]' \
'{Listing \\ref{\\detokenize{caption:name-test-py}}}'
link = '\hyperref[\\detokenize{caption:name-test-py}]' \
'{Listing \\ref{\\detokenize{caption:name-test-py}}}'
assert caption in latex
assert label in latex
assert link in latex
@@ -275,12 +275,12 @@ def test_literalinclude_namedlink_latex(app, status, warning):
app.builder.build('index')
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
label1 = '\\def\\sphinxLiteralBlockLabel{\\label{\\detokenize{caption:name-test-py}}}'
link1 = '\\hyperref[\\detokenize{caption:name-test-py}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{Python}}'
link1 = '\\hyperref[\\detokenize{caption:name-test-py}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{Python}}'
label2 = ('\\def\\sphinxLiteralBlockLabel'
'{\\label{\\detokenize{namedblocks:some-python-code}}}')
link2 = '\\hyperref[\\detokenize{namedblocks:some-python-code}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{the python code}}}'
link2 = '\\hyperref[\\detokenize{namedblocks:some-python-code}]'\
'{\\sphinxcrossref{\\DUrole{std,std-ref}{the python code}}}'
assert label1 in latex
assert link1 in latex
assert label2 in latex

View File

@@ -42,7 +42,7 @@ def test_sectioning(app, status, warning):
num = subsect[0].split()[0]
assert re.match('[0-9]+[.0-9]*[.]', num), \
'Unnumbered section: %r' % subsect[0]
testsects(prefix + str(i+1) + '.', subsect, indent+4)
testsects(prefix + str(i + 1) + '.', subsect, indent + 4)
app.builder.build(['only'])
doctree = app.env.get_doctree('only')
@@ -51,6 +51,6 @@ def test_sectioning(app, status, warning):
parts = [getsects(n)
for n in [_n for _n in doctree.children if isinstance(_n, nodes.section)]]
for i, s in enumerate(parts):
testsects(str(i+1) + '.', s, 4)
testsects(str(i + 1) + '.', s, 4)
assert len(parts) == 4, 'Expected 4 document level headings, got:\n%s' % \
'\n'.join([p[0] for p in parts])

View File

@@ -31,7 +31,7 @@ def parse(name, string):
if not parser.eof:
print("Parsing stopped at", parser.pos)
print(string)
print('-'*parser.pos + '^')
print('-' * parser.pos + '^')
raise DefinitionError("")
# The scopedness would usually have been set by CPPEnumObject
if name == "enum":
@@ -495,7 +495,6 @@ def test_attributes():
output='__attribute__(()) static inline void f()')
# def test_print():
# # used for getting all the ids out for checking
# for a in ids:

View File

@@ -20,7 +20,7 @@ import mock
from sphinx import addnodes
from sphinx.ext.intersphinx import setup as intersphinx_setup
from sphinx.ext.intersphinx import read_inventory, \
load_mappings, missing_reference, _strip_basic_auth, _read_from_url, \
load_mappings, missing_reference, _strip_basic_auth, \
_get_safe_url, fetch_inventory, INVENTORY_FILENAME

View File

@@ -36,7 +36,7 @@ def test_jsmath(app, status, warning):
@pytest.mark.sphinx('html', testroot='ext-math-simple',
confoverrides = {'extensions': ['sphinx.ext.imgmath']})
confoverrides = {'extensions': ['sphinx.ext.imgmath']})
def test_imgmath_png(app, status, warning):
app.builder.build_all()
if "LaTeX command 'latex' cannot be run" in warning.getvalue():
@@ -51,8 +51,8 @@ def test_imgmath_png(app, status, warning):
@pytest.mark.sphinx('html', testroot='ext-math-simple',
confoverrides={'extensions': ['sphinx.ext.imgmath'],
'imgmath_image_format': 'svg'})
confoverrides={'extensions': ['sphinx.ext.imgmath'],
'imgmath_image_format': 'svg'})
def test_imgmath_svg(app, status, warning):
app.builder.build_all()
if "LaTeX command 'latex' cannot be run" in warning.getvalue():
@@ -67,7 +67,7 @@ def test_imgmath_svg(app, status, warning):
@pytest.mark.sphinx('html', testroot='ext-math',
confoverrides={'extensions': ['sphinx.ext.mathjax']})
confoverrides={'extensions': ['sphinx.ext.mathjax']})
def test_mathjax_align(app, status, warning):
app.builder.build_all()
@@ -79,8 +79,8 @@ def test_mathjax_align(app, status, warning):
@pytest.mark.sphinx('html', testroot='ext-math',
confoverrides={'math_number_all': True,
'extensions': ['sphinx.ext.mathjax']})
confoverrides={'math_number_all': True,
'extensions': ['sphinx.ext.mathjax']})
def test_math_number_all_mathjax(app, status, warning):
app.builder.build_all()
@@ -91,7 +91,7 @@ def test_math_number_all_mathjax(app, status, warning):
@pytest.mark.sphinx('latex', testroot='ext-math',
confoverrides={'extensions': ['sphinx.ext.mathjax']})
confoverrides={'extensions': ['sphinx.ext.mathjax']})
def test_math_number_all_latex(app, status, warning):
app.builder.build_all()

View File

@@ -15,7 +15,7 @@ import pytest
@pytest.mark.sphinx('html', testroot='ext-todo', freshenv=True,
confoverrides={'todo_include_todos': True, 'todo_emit_warnings': True})
confoverrides={'todo_include_todos': True, 'todo_emit_warnings': True})
def test_todo(app, status, warning):
todos = []
@@ -51,7 +51,7 @@ def test_todo(app, status, warning):
@pytest.mark.sphinx('html', testroot='ext-todo', freshenv=True,
confoverrides={'todo_include_todos': False, 'todo_emit_warnings': True})
confoverrides={'todo_include_todos': False, 'todo_emit_warnings': True})
def test_todo_not_included(app, status, warning):
todos = []

View File

@@ -20,8 +20,10 @@ from babel.messages import pofile, mofile
from six import string_types
import pytest
from util import tempdir, rootdir, path, assert_re_search, \
assert_not_re_search, assert_startswith, assert_node, etree_parse, strip_escseq
from util import (
path, etree_parse, strip_escseq,
assert_re_search, assert_not_re_search, assert_startswith, assert_node
)
sphinx_intl = pytest.mark.sphinx(
@@ -451,6 +453,22 @@ def test_gettext_glossary_term_inconsistencies(app):
assert expect_msg.id in [m.id for m in actual if m.id]
@sphinx_intl
@pytest.mark.sphinx('gettext')
@pytest.mark.test_params(shared_result='test_intl_gettext')
def test_gettext_literalblock(app):
app.build()
# --- gettext builder always ignores ``only`` directive
expect = read_po(app.srcdir / 'literalblock.po')
actual = read_po(app.outdir / 'literalblock.pot')
for expect_msg in [m for m in expect if m.id]:
if len(expect_msg.id.splitlines()) == 1:
# compare tranlsations only labels
assert expect_msg.id in [m.id for m in actual if m.id]
else:
pass # skip code-blocks and literalblocks
@sphinx_intl
@pytest.mark.sphinx('gettext')
@pytest.mark.test_params(shared_result='test_intl_gettext')
@@ -559,6 +577,7 @@ def test_html_index_entries(app):
start_tag = "<%s[^>]*>" % tag
end_tag = "</%s>" % tag
return r"%s\s*%s\s*%s" % (start_tag, keyword, end_tag)
def wrap_nest(parenttag, childtag, keyword):
start_tag1 = "<%s[^>]*>" % parenttag
start_tag2 = "<%s[^>]*>" % childtag
@@ -781,9 +800,9 @@ def test_xml_keep_external_links(app):
['http://example.com/external2',
'http://example.com/external1'])
assert_elem(
para1[1],
['LINK TO', 'THE PYTHON SITE', 'AND', 'THE SPHINX SITE', '.'],
['http://python.org', 'http://sphinx-doc.org'])
para1[1],
['LINK TO', 'THE PYTHON SITE', 'AND', 'THE SPHINX SITE', '.'],
['http://python.org', 'http://sphinx-doc.org'])
# multiple references in the same line
para2 = secs[2].findall('paragraph')

View File

@@ -119,6 +119,7 @@ def get_verifier(verify, verify_re):
'verify': verify,
'verify_re': verify_re,
}
def get(name):
return v[name]
return get
@@ -258,7 +259,7 @@ def test_keep_warnings_is_True(app, status, warning):
@pytest.mark.sphinx('dummy', testroot='keep_warnings',
confoverrides={'keep_warnings': False})
confoverrides={'keep_warnings': False})
def test_keep_warnings_is_False(app, status, warning):
app.builder.build_all()
doctree = pickle.loads((app.doctreedir / 'index.doctree').bytes())

View File

@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
from docutils import frontend, utils
from docutils.parsers import rst

View File

@@ -83,11 +83,10 @@ def nonascii_srcdir(request, setup_command):
master_doc = srcdir / 'contents.txt'
master_doc.write_bytes((master_doc.text() + dedent("""
.. toctree::
.. toctree::
%(mb_name)s/%(mb_name)s
""" % locals())
).encode('utf-8'))
%(mb_name)s/%(mb_name)s
""" % locals())).encode('utf-8'))
@pytest.mark.usefixtures('nonascii_srcdir')

View File

@@ -17,7 +17,7 @@ import pytest
from sphinx.theming import Theme, ThemeError
from util import with_app, path
from util import path
@pytest.mark.sphinx(

View File

@@ -10,6 +10,7 @@
"""
import pytest
@pytest.mark.sphinx(testroot='toctree-glob')
def test_relations(app, status, warning):
app.builder.build_all()

View File

@@ -161,8 +161,8 @@ def test_moderation(support):
session.close()
accepted = support.add_comment('Accepted Comment', node_id=node.id,
displayed=False)
deleted = support.add_comment('Comment to delete', node_id=node.id,
displayed=False)
deleted = support.add_comment('Comment to delete', node_id=node.id,
displayed=False)
# Make sure the moderation_callback is called.
assert called
# Make sure the user must be a moderator.

View File

@@ -15,6 +15,7 @@ from functools import wraps
from xml.etree import ElementTree
from six import string_types
from six import StringIO
import pytest
@@ -207,8 +208,6 @@ def strip_escseq(text):
# #############################################
# DEPRECATED implementations
from six import StringIO
def gen_with_app(*args, **kwargs):
"""