mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6539 from tk0miya/fix_flake8_violations
Fix flake8 violations
This commit is contained in:
commit
852c061cc6
@ -15,5 +15,3 @@ class Derived(Base):
|
|||||||
def inheritedmeth(self):
|
def inheritedmeth(self):
|
||||||
# no docstring here
|
# no docstring here
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +52,8 @@ def test_msgfmt(app):
|
|||||||
|
|
||||||
assert (app.outdir / 'en_US.po').isfile(), 'msginit failed'
|
assert (app.outdir / 'en_US.po').isfile(), 'msginit failed'
|
||||||
try:
|
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)
|
subprocess.run(args, stdout=PIPE, stderr=PIPE, check=True)
|
||||||
except OSError:
|
except OSError:
|
||||||
pytest.skip() # most likely msgfmt was not found
|
pytest.skip() # most likely msgfmt was not found
|
||||||
|
@ -1405,6 +1405,7 @@ def test_latex_figure_in_admonition(app, status, warning):
|
|||||||
result = (app.outdir / 'python.tex').text(encoding='utf8')
|
result = (app.outdir / 'python.tex').text(encoding='utf8')
|
||||||
assert(r'\begin{figure}[H]' in result)
|
assert(r'\begin{figure}[H]' in result)
|
||||||
|
|
||||||
|
|
||||||
def test_default_latex_documents():
|
def test_default_latex_documents():
|
||||||
from sphinx.util import texescape
|
from sphinx.util import texescape
|
||||||
texescape.init()
|
texescape.init()
|
||||||
|
@ -129,14 +129,14 @@ def test_expressions():
|
|||||||
'5e42', '5e+42', '5e-42',
|
'5e42', '5e+42', '5e-42',
|
||||||
'5.', '5.e42', '5.e+42', '5.e-42',
|
'5.', '5.e42', '5.e+42', '5.e-42',
|
||||||
'.5', '.5e42', '.5e+42', '.5e-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
|
expr = e + suffix
|
||||||
exprCheck(expr, 'L' + expr + 'E')
|
exprCheck(expr, 'L' + expr + 'E')
|
||||||
for e in [
|
for e in [
|
||||||
'ApF', 'Ap+F', 'Ap-F',
|
'ApF', 'Ap+F', 'Ap-F',
|
||||||
'A.', 'A.pF', 'A.p+F', 'A.p-F',
|
'A.', 'A.pF', 'A.p+F', 'A.p-F',
|
||||||
'.A', '.ApF', '.Ap+F', '.Ap-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
|
expr = "0x" + e + suffix
|
||||||
exprCheck(expr, 'L' + expr + 'E')
|
exprCheck(expr, 'L' + expr + 'E')
|
||||||
exprCheck('"abc\\"cba"', 'LA8_KcE') # string
|
exprCheck('"abc\\"cba"', 'LA8_KcE') # string
|
||||||
@ -676,7 +676,7 @@ def test_template_args():
|
|||||||
|
|
||||||
|
|
||||||
def test_initializers():
|
def test_initializers():
|
||||||
idsMember = {1: 'v__T', 2:'1v'}
|
idsMember = {1: 'v__T', 2: '1v'}
|
||||||
idsFunction = {1: 'f__T', 2: '1f1T'}
|
idsFunction = {1: 'f__T', 2: '1f1T'}
|
||||||
idsTemplate = {2: 'I_1TE1fv', 4: 'I_1TE1fvv'}
|
idsTemplate = {2: 'I_1TE1fv', 4: 'I_1TE1fvv'}
|
||||||
# no init
|
# no init
|
||||||
@ -748,7 +748,7 @@ def test_attributes():
|
|||||||
{1: 'f', 2: '1fv'},
|
{1: 'f', 2: '1fv'},
|
||||||
output='[[attr1]] [[attr2]] void f()')
|
output='[[attr1]] [[attr2]] void f()')
|
||||||
# position: declarator
|
# 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'},
|
check('member', 'int *const [[attr]] volatile i', {1: 'i__iPVC', 2: '1i'},
|
||||||
output='int *[[attr]] volatile const i')
|
output='int *[[attr]] volatile const i')
|
||||||
check('member', 'int &[[attr]] i', {1: 'i__iR', 2: '1i'})
|
check('member', 'int &[[attr]] i', {1: 'i__iR', 2: '1i'})
|
||||||
|
@ -18,14 +18,16 @@ def test_githubpages(app, status, warning):
|
|||||||
assert not (app.outdir / 'CNAME').exists()
|
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):
|
def test_no_cname_for_github_io_domain(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
assert (app.outdir / '.nojekyll').exists()
|
assert (app.outdir / '.nojekyll').exists()
|
||||||
assert not (app.outdir / 'CNAME').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):
|
def test_cname_for_custom_domain(app, status, warning):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
assert (app.outdir / '.nojekyll').exists()
|
assert (app.outdir / '.nojekyll').exists()
|
||||||
|
@ -107,7 +107,7 @@ def test_text_emit_warnings(app, warning):
|
|||||||
# test warnings in translation
|
# test warnings in translation
|
||||||
warnings = getwarning(warning)
|
warnings = getwarning(warning)
|
||||||
warning_expr = ('.*/warnings.txt:4:<translated>:1: '
|
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)
|
assert_re_search(warning_expr, warnings)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import datetime
|
|||||||
import functools
|
import functools
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
from textwrap import dedent
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
from sphinx.testing.util import strip_escseq
|
from sphinx.testing.util import strip_escseq
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
from sphinx.util.pycompat import execfile_
|
from sphinx.util.pycompat import execfile_
|
||||||
|
Loading…
Reference in New Issue
Block a user