Fixed E251 flake8 errors
unexpected spaces around keyword / parameter equals
This commit is contained in:
parent
4c24947785
commit
b226454582
|
@ -198,8 +198,7 @@ class Source(object):
|
||||||
# public API shortcut functions
|
# public API shortcut functions
|
||||||
#
|
#
|
||||||
|
|
||||||
def compile_(source, filename=None, mode='exec', flags=
|
def compile_(source, filename=None, mode='exec', flags=generators.compiler_flag, dont_inherit=0):
|
||||||
generators.compiler_flag, dont_inherit=0):
|
|
||||||
""" compile the given source to a raw code object,
|
""" compile the given source to a raw code object,
|
||||||
and maintain an internal cache which allows later
|
and maintain an internal cache which allows later
|
||||||
retrieval of the source code for the code object
|
retrieval of the source code for the code object
|
||||||
|
|
|
@ -44,7 +44,7 @@ def pytest_addoption(parser):
|
||||||
help="display pytest lib version and import information.")
|
help="display pytest lib version and import information.")
|
||||||
group._addoption("-h", "--help", action=HelpAction, dest="help",
|
group._addoption("-h", "--help", action=HelpAction, dest="help",
|
||||||
help="show help message and configuration info")
|
help="show help message and configuration info")
|
||||||
group._addoption('-p', action="append", dest="plugins", default = [],
|
group._addoption('-p', action="append", dest="plugins", default=[],
|
||||||
metavar="name",
|
metavar="name",
|
||||||
help="early-load given plugin (multi-allowed). "
|
help="early-load given plugin (multi-allowed). "
|
||||||
"To avoid loading of plugins, use the `no:` prefix, e.g. "
|
"To avoid loading of plugins, use the `no:` prefix, e.g. "
|
||||||
|
|
|
@ -871,7 +871,7 @@ class Testdir:
|
||||||
kw = {self.request.function.__name__: Source(source).strip()}
|
kw = {self.request.function.__name__: Source(source).strip()}
|
||||||
path = self.makepyfile(**kw)
|
path = self.makepyfile(**kw)
|
||||||
if withinit:
|
if withinit:
|
||||||
self.makepyfile(__init__ = "#")
|
self.makepyfile(__init__="#")
|
||||||
self.config = config = self.parseconfigure(path, *configargs)
|
self.config = config = self.parseconfigure(path, *configargs)
|
||||||
node = self.getnode(config, path)
|
node = self.getnode(config, path)
|
||||||
|
|
||||||
|
|
|
@ -176,8 +176,7 @@ def pytest_pycollect_makeitem(collector, name, obj):
|
||||||
# or a funtools.wrapped.
|
# or a funtools.wrapped.
|
||||||
# We musn't if it's been wrapped with mock.patch (python 2 only)
|
# We musn't if it's been wrapped with mock.patch (python 2 only)
|
||||||
if not (isfunction(obj) or isfunction(get_real_func(obj))):
|
if not (isfunction(obj) or isfunction(get_real_func(obj))):
|
||||||
collector.warn(code="C2", message=
|
collector.warn(code="C2", message="cannot collect %r because it is not a function."
|
||||||
"cannot collect %r because it is not a function."
|
|
||||||
% name, )
|
% name, )
|
||||||
elif getattr(obj, "__test__", True):
|
elif getattr(obj, "__test__", True):
|
||||||
if is_generator(obj):
|
if is_generator(obj):
|
||||||
|
|
|
@ -99,7 +99,7 @@ class TestConfigCmdlineParsing(object):
|
||||||
[pytest]
|
[pytest]
|
||||||
custom = 0
|
custom = 0
|
||||||
""")
|
""")
|
||||||
testdir.makefile(".cfg", custom = """
|
testdir.makefile(".cfg", custom="""
|
||||||
[pytest]
|
[pytest]
|
||||||
custom = 1
|
custom = 1
|
||||||
""")
|
""")
|
||||||
|
|
|
@ -238,7 +238,7 @@ class TestParser(object):
|
||||||
assert args.file_or_dir == ['abcd']
|
assert args.file_or_dir == ['abcd']
|
||||||
|
|
||||||
def test_drop_short_help0(self, parser, capsys):
|
def test_drop_short_help0(self, parser, capsys):
|
||||||
parser.addoption('--func-args', '--doit', help = 'foo',
|
parser.addoption('--func-args', '--doit', help='foo',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
parser.parse([])
|
parser.parse([])
|
||||||
help = parser.optparser.format_help()
|
help = parser.optparser.format_help()
|
||||||
|
|
|
@ -16,8 +16,8 @@ def test_generic_path(testdir):
|
||||||
p1 = Node('a', config=config, session=session)
|
p1 = Node('a', config=config, session=session)
|
||||||
#assert p1.fspath is None
|
#assert p1.fspath is None
|
||||||
p2 = Node('B', parent=p1)
|
p2 = Node('B', parent=p1)
|
||||||
p3 = Node('()', parent = p2)
|
p3 = Node('()', parent=p2)
|
||||||
item = Item('c', parent = p3)
|
item = Item('c', parent=p3)
|
||||||
|
|
||||||
res = generic_path(item)
|
res = generic_path(item)
|
||||||
assert res == 'a.B().c'
|
assert res == 'a.B().c'
|
||||||
|
@ -25,9 +25,9 @@ def test_generic_path(testdir):
|
||||||
p0 = FSCollector('proj/test', config=config, session=session)
|
p0 = FSCollector('proj/test', config=config, session=session)
|
||||||
p1 = FSCollector('proj/test/a', parent=p0)
|
p1 = FSCollector('proj/test/a', parent=p0)
|
||||||
p2 = Node('B', parent=p1)
|
p2 = Node('B', parent=p1)
|
||||||
p3 = Node('()', parent = p2)
|
p3 = Node('()', parent=p2)
|
||||||
p4 = Node('c', parent=p3)
|
p4 = Node('c', parent=p3)
|
||||||
item = Item('[1]', parent = p4)
|
item = Item('[1]', parent=p4)
|
||||||
|
|
||||||
res = generic_path(item)
|
res = generic_path(item)
|
||||||
assert res == 'test/a:B().c[1]'
|
assert res == 'test/a:B().c[1]'
|
||||||
|
|
|
@ -699,7 +699,7 @@ def test_skipped_reasons_functional(testdir):
|
||||||
def test_method(self):
|
def test_method(self):
|
||||||
doskip()
|
doskip()
|
||||||
""",
|
""",
|
||||||
conftest = """
|
conftest="""
|
||||||
import pytest
|
import pytest
|
||||||
def doskip():
|
def doskip():
|
||||||
pytest.skip('test')
|
pytest.skip('test')
|
||||||
|
|
|
@ -38,7 +38,7 @@ def pytest_generate_tests(metafunc):
|
||||||
metafunc.addcall(id="verbose",
|
metafunc.addcall(id="verbose",
|
||||||
funcargs={'option': Option(verbose=True)})
|
funcargs={'option': Option(verbose=True)})
|
||||||
metafunc.addcall(id="quiet",
|
metafunc.addcall(id="quiet",
|
||||||
funcargs={'option': Option(verbose= -1)})
|
funcargs={'option': Option(verbose=-1)})
|
||||||
metafunc.addcall(id="fulltrace",
|
metafunc.addcall(id="fulltrace",
|
||||||
funcargs={'option': Option(fulltrace=True)})
|
funcargs={'option': Option(fulltrace=True)})
|
||||||
|
|
||||||
|
|
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 = E251,E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731
|
ignore = E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,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