summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2014-10-09 23:53:33 +0900
committershimizukawa <shimizukawa@gmail.com>2014-10-09 23:53:33 +0900
commit5c2f6935b4083841c53b1c2f21d8c76208c7d69b (patch)
treee5e2dbc129446e1600db39103c2fbe5d11204073 /tests
parent24366f0f01d011d82dae0dd1d39514247d8b21ee (diff)
downloadsphinx-5c2f6935b4083841c53b1c2f21d8c76208c7d69b.tar.gz
fix trailing space and long line
Diffstat (limited to 'tests')
-rw-r--r--tests/roots/test-autosummary/contents.rst2
-rw-r--r--tests/roots/test-ext-viewcode/objects.rst2
-rw-r--r--tests/test_api_translator.py3
-rw-r--r--tests/test_autodoc.py12
-rw-r--r--tests/test_build.py16
-rw-r--r--tests/test_build_gettext.py5
-rw-r--r--tests/test_build_html.py3
-rw-r--r--tests/test_domain_cpp.py35
8 files changed, 53 insertions, 25 deletions
diff --git a/tests/roots/test-autosummary/contents.rst b/tests/roots/test-autosummary/contents.rst
index cd4b7c5e..0355c95b 100644
--- a/tests/roots/test-autosummary/contents.rst
+++ b/tests/roots/test-autosummary/contents.rst
@@ -2,6 +2,6 @@
.. autosummary::
:nosignatures:
:toctree:
-
+
dummy_module
sphinx
diff --git a/tests/roots/test-ext-viewcode/objects.rst b/tests/roots/test-ext-viewcode/objects.rst
index 8d304bec..fcea2165 100644
--- a/tests/roots/test-ext-viewcode/objects.rst
+++ b/tests/roots/test-ext-viewcode/objects.rst
@@ -46,7 +46,7 @@ Referring to :func:`nothing <>`.
.. object:: long(parameter, \
list)
- another one
+ another one
.. class:: TimeInt
diff --git a/tests/test_api_translator.py b/tests/test_api_translator.py
index e0ba5e0f..4dd70a2c 100644
--- a/tests/test_api_translator.py
+++ b/tests/test_api_translator.py
@@ -58,7 +58,8 @@ def test_html_with_set_translator_for_html_(app, status, warning):
@with_app('html', testroot='api-set-translator',
confoverrides={'html_translator_class': 'ext.ExtHTMLTranslator'})
-def test_html_with_set_translator_for_html_and_html_translator_class(app, status, warning):
+def test_html_with_set_translator_for_html_and_html_translator_class(
+ app, status, warning):
# use set_translator() and html_translator_class.
# set_translator() is given priority over html_translator_clas.
translator_class = app.builder.translator_class
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index f4ae0c08..10921b65 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -434,21 +434,25 @@ def test_docstring_property_processing():
return results, docstrings
directive.env.config.autodoc_docstring_signature = False
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
assert '.. py:attribute:: DocstringSig.prop1' in results
assert 'First line of docstring' in docstrings
assert 'DocstringSig.prop1(self)' in docstrings
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
assert '.. py:attribute:: DocstringSig.prop2' in results
assert 'First line of docstring' in docstrings
assert 'Second line of docstring' in docstrings
directive.env.config.autodoc_docstring_signature = True
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
assert '.. py:attribute:: DocstringSig.prop1' in results
assert 'First line of docstring' in docstrings
assert 'DocstringSig.prop1(self)' not in docstrings
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
assert '.. py:attribute:: DocstringSig.prop2' in results
assert 'First line of docstring' in docstrings
assert 'Second line of docstring' in docstrings
diff --git a/tests/test_build.py b/tests/test_build.py
index fe38cfaf..117bb84c 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -76,13 +76,21 @@ def test_build_all():
def test_circular_toctree(app, status, warning):
app.builder.build_all()
warnings = warning.getvalue()
- assert 'circular toctree references detected, ignoring: sub <- contents <- sub' in warnings
- assert 'circular toctree references detected, ignoring: contents <- sub <- contents' in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'sub <- contents <- sub') in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'contents <- sub <- contents') in warnings
@with_app(buildername='text', testroot='numbered-circular')
def test_numbered_circular_toctree(app, status, warning):
app.builder.build_all()
warnings = warning.getvalue()
- assert 'circular toctree references detected, ignoring: sub <- contents <- sub' in warnings
- assert 'circular toctree references detected, ignoring: contents <- sub <- contents' in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'sub <- contents <- sub') in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'contents <- sub <- contents') in warnings
diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py
index 1de1306e..677f3505 100644
--- a/tests/test_build_gettext.py
+++ b/tests/test_build_gettext.py
@@ -66,8 +66,9 @@ def test_all(app, status, warning):
print(stderr)
assert False, 'msgfmt exited with return code %s' % \
p.returncode
- yield assert_true, (app.outdir / 'en' / 'LC_MESSAGES' / 'test_root.mo').isfile(), \
- 'msgfmt failed'
+ yield (assert_true,
+ (app.outdir / 'en' / 'LC_MESSAGES' / 'test_root.mo').isfile(),
+ 'msgfmt failed')
finally:
os.chdir(cwd)
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index baf3b6a6..65fdc9fc 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -141,7 +141,8 @@ HTML_XPATH = {
(".//a[@href='http://www.python.org/dev/peps/pep-0008']"
"[@class='pep reference external']/strong", 'PEP 8'),
(".//a[@href='http://www.python.org/dev/peps/pep-0008']"
- "[@class='pep reference external']/strong", 'Python Enhancement Proposal #8'),
+ "[@class='pep reference external']/strong",
+ 'Python Enhancement Proposal #8'),
(".//a[@href='http://tools.ietf.org/html/rfc1.html']"
"[@class='rfc reference external']/strong", 'RFC 1'),
(".//a[@href='http://tools.ietf.org/html/rfc1.html']"
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
index 0b4219a5..5b839fad 100644
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -27,7 +27,8 @@ def parse(name, string):
def check(name, input, output=None):
# first a simple check of the AST
- if output == None: output = input
+ if output is None:
+ output = input
ast = parse(name, input)
res = text_type(ast)
if res != output:
@@ -36,7 +37,8 @@ def check(name, input, output=None):
print("Expected: ", output)
raise DefinitionError("")
ast.describe_signature([], 'lastIsName', None)
- ast.prefixedName = ast.name # otherwise the get_id fails, it would be set in handle_signarue
+ ast.prefixedName = ast.name # otherwise the get_id fails, it would be set
+ # in handle_signarue
ast.get_id()
#print ".. %s:: %s" % (name, input)
@@ -49,7 +51,7 @@ def test_type_definitions():
check("type", "bool *volatile const b")
check("type", "bool *volatile const *b")
check("type", "bool &b")
- check("type", "bool b[]")
+ check("type", "bool b[]")
check("type", "std::pair<int, int> coord")
check("type", "long long int foo")
check("type", 'std::vector<std::pair<std::string, long long>> module::blah')
@@ -57,12 +59,20 @@ def test_type_definitions():
check("type", "std::function<R(A1, A2, A3)> F")
check("type", "std::function<R(A1, A2, A3, As...)> F")
check("type", "MyContainer::const_iterator")
- check("type", "public MyContainer::const_iterator", "MyContainer::const_iterator")
-
- check('member', ' const std::string & name = 42', 'const std::string &name = 42')
+ check("type",
+ "public MyContainer::const_iterator",
+ "MyContainer::const_iterator")
+
+ check('member',
+ ' const std::string & name = 42',
+ 'const std::string &name = 42')
check('member', ' const std::string & name', 'const std::string &name')
- check('member', ' const std::string & name [ n ]', 'const std::string &name[n]')
- check('member', 'const std::vector< unsigned int, long> &name', 'const std::vector<unsigned int, long> &name')
+ check('member',
+ ' const std::string & name [ n ]',
+ 'const std::string &name[n]')
+ check('member',
+ 'const std::vector< unsigned int, long> &name',
+ 'const std::vector<unsigned int, long> &name')
check('member', 'module::myclass foo[n]')
check('function', 'operator bool() const')
@@ -76,8 +86,10 @@ def test_type_definitions():
check('function', 'int foo(const unsigned int j)')
check('function', 'int foo(const int *const ptr)')
check('function', 'module::myclass::operator std::vector<std::string>()')
- check('function', 'void operator()(const boost::array<VertexID, 2> &v) const')
- check('function', 'void operator()(const boost::array<VertexID, 2, "foo, bar"> &v) const')
+ check('function',
+ 'void operator()(const boost::array<VertexID, 2> &v) const')
+ check('function',
+ 'void operator()(const boost::array<VertexID, 2, "foo, bar"> &v) const')
check('function', 'MyClass::MyClass(MyClass::MyClass&&)')
check('function', 'constexpr int get_value()')
check('function', 'static constexpr int get_value()')
@@ -101,7 +113,8 @@ def test_type_definitions():
x = 'std::vector<std::pair<std::string, int>> &module::test(register ' \
'foo, bar[n], std::string baz = "foobar, blah, bleh") const = 0'
check('function', x)
- check('function', 'int foo(Foo f = Foo(double(), std::make_pair(int(2), double(3.4))))')
+ check('function',
+ 'int foo(Foo f = Foo(double(), std::make_pair(int(2), double(3.4))))')
check('function', 'int foo(A a = x(a))')
raises(DefinitionError, parse, 'function', 'int foo(B b=x(a)')
raises(DefinitionError, parse, 'function', 'int foo)C c=x(a))')