Fixed E501 flake8 errors
line too long (> 120 characters)
This commit is contained in:
parent
b9e318866e
commit
7d2ceb7872
|
@ -211,7 +211,8 @@ class PytestPluginManager(PluginManager):
|
||||||
"""
|
"""
|
||||||
.. deprecated:: 2.8
|
.. deprecated:: 2.8
|
||||||
|
|
||||||
Use :py:meth:`pluggy.PluginManager.add_hookspecs <_pytest.vendored_packages.pluggy.PluginManager.add_hookspecs>` instead.
|
Use :py:meth:`pluggy.PluginManager.add_hookspecs <_pytest.vendored_packages.pluggy.PluginManager.add_hookspecs>`
|
||||||
|
instead.
|
||||||
"""
|
"""
|
||||||
warning = dict(code="I2",
|
warning = dict(code="I2",
|
||||||
fslocation=_pytest._code.getfslineno(sys._getframe(1)),
|
fslocation=_pytest._code.getfslineno(sys._getframe(1)),
|
||||||
|
|
|
@ -30,7 +30,8 @@ EXIT_NOTESTSCOLLECTED = 5
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
parser.addini("norecursedirs", "directory patterns to avoid for recursion",
|
parser.addini("norecursedirs", "directory patterns to avoid for recursion",
|
||||||
type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv'])
|
type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv'])
|
||||||
parser.addini("testpaths", "directories to search for tests when no files or directories are given in the command line.",
|
parser.addini("testpaths", "directories to search for tests when no files or directories are given in the "
|
||||||
|
"command line.",
|
||||||
type="args", default=[])
|
type="args", default=[])
|
||||||
# parser.addini("dirpatterns",
|
# parser.addini("dirpatterns",
|
||||||
# "patterns specifying possible locations of test files",
|
# "patterns specifying possible locations of test files",
|
||||||
|
@ -47,7 +48,8 @@ def pytest_addoption(parser):
|
||||||
group._addoption('--strict', action="store_true",
|
group._addoption('--strict', action="store_true",
|
||||||
help="marks not registered in configuration file raise errors.")
|
help="marks not registered in configuration file raise errors.")
|
||||||
group._addoption("-c", metavar="file", type=str, dest="inifilename",
|
group._addoption("-c", metavar="file", type=str, dest="inifilename",
|
||||||
help="load configuration from `file` instead of trying to locate one of the implicit configuration files.")
|
help="load configuration from `file` instead of trying to locate one of the implicit "
|
||||||
|
"configuration files.")
|
||||||
group._addoption("--continue-on-collection-errors", action="store_true",
|
group._addoption("--continue-on-collection-errors", action="store_true",
|
||||||
default=False, dest="continue_on_collection_errors",
|
default=False, dest="continue_on_collection_errors",
|
||||||
help="Force test execution even if collection errors occur.")
|
help="Force test execution even if collection errors occur.")
|
||||||
|
|
|
@ -29,7 +29,8 @@ class TestApprox(object):
|
||||||
if sys.version_info[:2] == (2, 6):
|
if sys.version_info[:2] == (2, 6):
|
||||||
tol1, tol2, infr = '???', '???', '???'
|
tol1, tol2, infr = '???', '???', '???'
|
||||||
assert repr(approx(1.0)) == '1.0 {pm} {tol1}'.format(pm=plus_minus, tol1=tol1)
|
assert repr(approx(1.0)) == '1.0 {pm} {tol1}'.format(pm=plus_minus, tol1=tol1)
|
||||||
assert repr(approx([1.0, 2.0])) == '1.0 {pm} {tol1}, 2.0 {pm} {tol2}'.format(pm=plus_minus, tol1=tol1, tol2=tol2)
|
assert repr(approx([1.0, 2.0])) == '1.0 {pm} {tol1}, 2.0 {pm} {tol2}'.format(
|
||||||
|
pm=plus_minus, tol1=tol1, tol2=tol2)
|
||||||
assert repr(approx(inf)) == 'inf'
|
assert repr(approx(inf)) == 'inf'
|
||||||
assert repr(approx(1.0, rel=nan)) == '1.0 {pm} ???'.format(pm=plus_minus)
|
assert repr(approx(1.0, rel=nan)) == '1.0 {pm} ???'.format(pm=plus_minus)
|
||||||
assert repr(approx(1.0, rel=inf)) == '1.0 {pm} {infr}'.format(pm=plus_minus, infr=infr)
|
assert repr(approx(1.0, rel=inf)) == '1.0 {pm} {infr}'.format(pm=plus_minus, infr=infr)
|
||||||
|
|
|
@ -178,11 +178,27 @@ class TestMetafunc(object):
|
||||||
"""
|
"""
|
||||||
from _pytest.python import _idval
|
from _pytest.python import _idval
|
||||||
values = [
|
values = [
|
||||||
(u'', ''),
|
(
|
||||||
(u'ascii', 'ascii'),
|
u'',
|
||||||
(u'ação', 'a\\xe7\\xe3o'),
|
''
|
||||||
(u'josé@blah.com', 'jos\\xe9@blah.com'),
|
),
|
||||||
(u'δοκ.ιμή@παράδειγμα.δοκιμή', '\\u03b4\\u03bf\\u03ba.\\u03b9\\u03bc\\u03ae@\\u03c0\\u03b1\\u03c1\\u03ac\\u03b4\\u03b5\\u03b9\\u03b3\\u03bc\\u03b1.\\u03b4\\u03bf\\u03ba\\u03b9\\u03bc\\u03ae'),
|
(
|
||||||
|
u'ascii',
|
||||||
|
'ascii'
|
||||||
|
),
|
||||||
|
(
|
||||||
|
u'ação',
|
||||||
|
'a\\xe7\\xe3o'
|
||||||
|
),
|
||||||
|
(
|
||||||
|
u'josé@blah.com',
|
||||||
|
'jos\\xe9@blah.com'
|
||||||
|
),
|
||||||
|
(
|
||||||
|
u'δοκ.ιμή@παράδειγμα.δοκιμή',
|
||||||
|
'\\u03b4\\u03bf\\u03ba.\\u03b9\\u03bc\\u03ae@\\u03c0\\u03b1\\u03c1\\u03ac\\u03b4\\u03b5\\u03b9\\u03b3'
|
||||||
|
'\\u03bc\\u03b1.\\u03b4\\u03bf\\u03ba\\u03b9\\u03bc\\u03ae'
|
||||||
|
),
|
||||||
]
|
]
|
||||||
for val, expected in values:
|
for val, expected in values:
|
||||||
assert _idval(val, 'a', 6, None) == expected
|
assert _idval(val, 'a', 6, None) == expected
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -196,6 +196,6 @@ filterwarnings =
|
||||||
ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
|
ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E501,E701,E702,E704,E712,E731
|
ignore = E701,E702,E704,E712,E731
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
exclude = _pytest/vendored_packages/pluggy.py
|
exclude = _pytest/vendored_packages/pluggy.py
|
||||||
|
|
Loading…
Reference in New Issue