Fixed E251 flake8 errors

unexpected spaces around keyword / parameter equals
This commit is contained in:
Andras Tim 2017-07-17 01:25:08 +02:00
parent 4c24947785
commit b226454582
10 changed files with 13 additions and 15 deletions

View File

@ -198,8 +198,7 @@ class Source(object):
# public API shortcut functions
#
def compile_(source, filename=None, mode='exec', flags=
generators.compiler_flag, dont_inherit=0):
def compile_(source, filename=None, mode='exec', flags=generators.compiler_flag, dont_inherit=0):
""" compile the given source to a raw code object,
and maintain an internal cache which allows later
retrieval of the source code for the code object

View File

@ -44,7 +44,7 @@ def pytest_addoption(parser):
help="display pytest lib version and import information.")
group._addoption("-h", "--help", action=HelpAction, dest="help",
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",
help="early-load given plugin (multi-allowed). "
"To avoid loading of plugins, use the `no:` prefix, e.g. "

View File

@ -871,7 +871,7 @@ class Testdir:
kw = {self.request.function.__name__: Source(source).strip()}
path = self.makepyfile(**kw)
if withinit:
self.makepyfile(__init__ = "#")
self.makepyfile(__init__="#")
self.config = config = self.parseconfigure(path, *configargs)
node = self.getnode(config, path)

View File

@ -176,8 +176,7 @@ def pytest_pycollect_makeitem(collector, name, obj):
# or a funtools.wrapped.
# We musn't if it's been wrapped with mock.patch (python 2 only)
if not (isfunction(obj) or isfunction(get_real_func(obj))):
collector.warn(code="C2", message=
"cannot collect %r because it is not a function."
collector.warn(code="C2", message="cannot collect %r because it is not a function."
% name, )
elif getattr(obj, "__test__", True):
if is_generator(obj):

View File

@ -99,7 +99,7 @@ class TestConfigCmdlineParsing(object):
[pytest]
custom = 0
""")
testdir.makefile(".cfg", custom = """
testdir.makefile(".cfg", custom="""
[pytest]
custom = 1
""")

View File

@ -238,7 +238,7 @@ class TestParser(object):
assert args.file_or_dir == ['abcd']
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')
parser.parse([])
help = parser.optparser.format_help()

View File

@ -16,8 +16,8 @@ def test_generic_path(testdir):
p1 = Node('a', config=config, session=session)
#assert p1.fspath is None
p2 = Node('B', parent=p1)
p3 = Node('()', parent = p2)
item = Item('c', parent = p3)
p3 = Node('()', parent=p2)
item = Item('c', parent=p3)
res = generic_path(item)
assert res == 'a.B().c'
@ -25,9 +25,9 @@ def test_generic_path(testdir):
p0 = FSCollector('proj/test', config=config, session=session)
p1 = FSCollector('proj/test/a', parent=p0)
p2 = Node('B', parent=p1)
p3 = Node('()', parent = p2)
p3 = Node('()', parent=p2)
p4 = Node('c', parent=p3)
item = Item('[1]', parent = p4)
item = Item('[1]', parent=p4)
res = generic_path(item)
assert res == 'test/a:B().c[1]'

View File

@ -699,7 +699,7 @@ def test_skipped_reasons_functional(testdir):
def test_method(self):
doskip()
""",
conftest = """
conftest="""
import pytest
def doskip():
pytest.skip('test')

View File

@ -38,7 +38,7 @@ def pytest_generate_tests(metafunc):
metafunc.addcall(id="verbose",
funcargs={'option': Option(verbose=True)})
metafunc.addcall(id="quiet",
funcargs={'option': Option(verbose= -1)})
funcargs={'option': Option(verbose=-1)})
metafunc.addcall(id="fulltrace",
funcargs={'option': Option(fulltrace=True)})

View File

@ -196,6 +196,6 @@ filterwarnings =
ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
[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
exclude = _pytest/vendored_packages/pluggy.py