diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-30 14:55:22 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-07-01 00:28:30 +0900 |
| commit | 95723aa6f648597682ff4107250fb042ddb40f50 (patch) | |
| tree | 6c9d8c3378ad31c37b7286c6c0a9474350e72e3a | |
| parent | b5f7d08ec7f9ad61dc764d3ac115ff3cc3b6dcf2 (diff) | |
| download | sphinx-git-95723aa6f648597682ff4107250fb042ddb40f50.tar.gz | |
Fix flake8 violations
| -rw-r--r-- | tests/roots/test-ext-autodoc/target/inheritance.py | 2 | ||||
| -rw-r--r-- | tests/test_build_gettext.py | 3 | ||||
| -rw-r--r-- | tests/test_build_latex.py | 1 | ||||
| -rw-r--r-- | tests/test_directive_code.py | 2 | ||||
| -rw-r--r-- | tests/test_domain_cpp.py | 8 | ||||
| -rw-r--r-- | tests/test_ext_autosummary.py | 4 | ||||
| -rw-r--r-- | tests/test_ext_githubpages.py | 6 | ||||
| -rw-r--r-- | tests/test_intl.py | 2 | ||||
| -rw-r--r-- | tests/test_util_inspect.py | 1 | ||||
| -rw-r--r-- | tests/test_util_pycompat.py | 2 |
10 files changed, 15 insertions, 16 deletions
diff --git a/tests/roots/test-ext-autodoc/target/inheritance.py b/tests/roots/test-ext-autodoc/target/inheritance.py index 3a5fc0711..ffac84bb6 100644 --- a/tests/roots/test-ext-autodoc/target/inheritance.py +++ b/tests/roots/test-ext-autodoc/target/inheritance.py @@ -15,5 +15,3 @@ class Derived(Base): def inheritedmeth(self): # no docstring here pass - - diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py index 26c63771a..b41ceb2d3 100644 --- a/tests/test_build_gettext.py +++ b/tests/test_build_gettext.py @@ -52,7 +52,8 @@ def test_msgfmt(app): assert (app.outdir / 'en_US.po').isfile(), 'msginit failed' try: - args = ['msgfmt', 'en_US.po', '-o', os.path.join('en', 'LC_MESSAGES', 'test_root.mo')] + args = ['msgfmt', 'en_US.po', + '-o', os.path.join('en', 'LC_MESSAGES', 'test_root.mo')] subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True) except OSError: pytest.skip() # most likely msgfmt was not found diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 264f4e8b0..67491ddc9 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -1395,6 +1395,7 @@ def test_latex_figure_in_admonition(app, status, warning): result = (app.outdir / 'python.tex').text(encoding='utf8') assert(r'\begin{figure}[H]' in result) + def test_default_latex_documents(): from sphinx.util import texescape texescape.init() diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py index d1f7c03dc..13b451078 100644 --- a/tests/test_directive_code.py +++ b/tests/test_directive_code.py @@ -617,6 +617,6 @@ def test_linenothreshold(app, status, warning): # literal include not using linenothreshold html, matched, _ = html.partition(lineos_head + '1\n' - '2\n' + '2\n' '3' + lineos_tail) assert not matched diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index c81d66b17..bbb4cc55e 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -129,14 +129,14 @@ def test_expressions(): '5e42', '5e+42', '5e-42', '5.', '5.e42', '5.e+42', '5.e-42', '.5', '.5e42', '.5e+42', '.5e-42', - '5.0', '5.0e42','5.0e+42', '5.0e-42']: + '5.0', '5.0e42', '5.0e+42', '5.0e-42']: expr = e + suffix exprCheck(expr, 'L' + expr + 'E') for e in [ 'ApF', 'Ap+F', 'Ap-F', 'A.', 'A.pF', 'A.p+F', 'A.p-F', '.A', '.ApF', '.Ap+F', '.Ap-F', - 'A.B', 'A.BpF','A.Bp+F', 'A.Bp-F']: + 'A.B', 'A.BpF', 'A.Bp+F', 'A.Bp-F']: expr = "0x" + e + suffix exprCheck(expr, 'L' + expr + 'E') exprCheck('"abc\\"cba"', 'LA8_KcE') # string @@ -676,7 +676,7 @@ def test_template_args(): def test_initializers(): - idsMember = {1: 'v__T', 2:'1v'} + idsMember = {1: 'v__T', 2: '1v'} idsFunction = {1: 'f__T', 2: '1f1T'} idsTemplate = {2: 'I_1TE1fv', 4: 'I_1TE1fvv'} # no init @@ -748,7 +748,7 @@ def test_attributes(): {1: 'f', 2: '1fv'}, output='[[attr1]] [[attr2]] void f()') # position: declarator - check('member', 'int *[[attr]] i', {1: 'i__iP', 2:'1i'}) + check('member', 'int *[[attr]] i', {1: 'i__iP', 2: '1i'}) check('member', 'int *const [[attr]] volatile i', {1: 'i__iPVC', 2: '1i'}, output='int *[[attr]] volatile const i') check('member', 'int &[[attr]] i', {1: 'i__iR', 2: '1i'}) diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index 1e50ac0ac..21841cc74 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -311,8 +311,8 @@ def test_empty_autosummary_generate(app, status, warning): assert ("WARNING: autosummary: stub file not found 'autosummary_importfail'" in warning.getvalue()) - + @pytest.mark.sphinx('dummy', testroot='ext-autosummary', confoverrides={'autosummary_generate': ['unknown']}) def test_invalid_autosummary_generate(app, status, warning): - assert 'WARNING: autosummary_generate: file not found: unknown.rst' in warning.getvalue()
\ No newline at end of file + assert 'WARNING: autosummary_generate: file not found: unknown.rst' in warning.getvalue() diff --git a/tests/test_ext_githubpages.py b/tests/test_ext_githubpages.py index 450a25498..132d95e03 100644 --- a/tests/test_ext_githubpages.py +++ b/tests/test_ext_githubpages.py @@ -18,14 +18,16 @@ def test_githubpages(app, status, warning): assert not (app.outdir / 'CNAME').exists() -@pytest.mark.sphinx('html', testroot='ext-githubpages', confoverrides={'html_baseurl': 'https://sphinx-doc.github.io'}) +@pytest.mark.sphinx('html', testroot='ext-githubpages', + confoverrides={'html_baseurl': 'https://sphinx-doc.github.io'}) def test_no_cname_for_github_io_domain(app, status, warning): app.builder.build_all() assert (app.outdir / '.nojekyll').exists() assert not (app.outdir / 'CNAME').exists() -@pytest.mark.sphinx('html', testroot='ext-githubpages', confoverrides={'html_baseurl': 'https://sphinx-doc.org'}) +@pytest.mark.sphinx('html', testroot='ext-githubpages', + confoverrides={'html_baseurl': 'https://sphinx-doc.org'}) def test_cname_for_custom_domain(app, status, warning): app.builder.build_all() assert (app.outdir / '.nojekyll').exists() diff --git a/tests/test_intl.py b/tests/test_intl.py index 9790f50a3..3815f8357 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -107,7 +107,7 @@ def test_text_emit_warnings(app, warning): # test warnings in translation warnings = getwarning(warning) warning_expr = ('.*/warnings.txt:4:<translated>:1: ' - 'WARNING: Inline literal start-string without end-string.\n') + 'WARNING: Inline literal start-string without end-string.\n') assert_re_search(warning_expr, warnings) diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py index 22f8ded6f..0681352e3 100644 --- a/tests/test_util_inspect.py +++ b/tests/test_util_inspect.py @@ -13,7 +13,6 @@ import datetime import functools import sys import types -from textwrap import dedent import pytest diff --git a/tests/test_util_pycompat.py b/tests/test_util_pycompat.py index 6ffc83f84..a5d743972 100644 --- a/tests/test_util_pycompat.py +++ b/tests/test_util_pycompat.py @@ -8,8 +8,6 @@ :license: BSD, see LICENSE for details. """ -import tempfile - from sphinx.testing.util import strip_escseq from sphinx.util import logging from sphinx.util.pycompat import execfile_ |
