diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index 6ec54d7e7..1849d9cba 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -723,7 +723,7 @@ class AssertionRewriter(ast.NodeVisitor): if isinstance(assert_.test, ast.Tuple) and self.config is not None: fslocation = (self.module_path, assert_.lineno) self.config.warn('R1', 'assertion is always true, perhaps ' - 'remove parentheses?', fslocation=fslocation) + 'remove parentheses?', fslocation=fslocation) self.statements = [] self.variables = [] self.variable_counter = itertools.count() diff --git a/_pytest/compat.py b/_pytest/compat.py index 269a23504..1b2d95ce3 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -79,7 +79,7 @@ def num_mock_patch_args(function): mock = sys.modules.get("mock", sys.modules.get("unittest.mock", None)) if mock is not None: return len([p for p in patchings - if not p.attribute_name and p.new is mock.DEFAULT]) + if not p.attribute_name and p.new is mock.DEFAULT]) return len(patchings) diff --git a/_pytest/config.py b/_pytest/config.py index d70ea4507..bf51c67f4 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -304,7 +304,7 @@ class PytestPluginManager(PluginManager): """ current = py.path.local() self._confcutdir = current.join(namespace.confcutdir, abs=True) \ - if namespace.confcutdir else None + if namespace.confcutdir else None self._noconftest = namespace.noconftest testpaths = namespace.file_or_dir foundanchor = False diff --git a/_pytest/doctest.py b/_pytest/doctest.py index cbd39652e..f6d36c3de 100644 --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -132,7 +132,7 @@ class DoctestItem(pytest.Item): else: inner_excinfo = ExceptionInfo(excinfo.value.exc_info) lines += ["UNEXPECTED EXCEPTION: %s" % - repr(inner_excinfo.value)] + repr(inner_excinfo.value)] lines += traceback.format_exception(*excinfo.value.exc_info) return ReprFailDoctest(reprlocation, lines) else: diff --git a/_pytest/junitxml.py b/_pytest/junitxml.py index 9d098051c..ed3ba2e9a 100644 --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -378,8 +378,8 @@ class LogXML(object): close_report = next( (rep for rep in self.open_reports if (rep.nodeid == report.nodeid and - getattr(rep, "item_index", None) == report_ii and - getattr(rep, "worker_id", None) == report_wid + getattr(rep, "item_index", None) == report_ii and + getattr(rep, "worker_id", None) == report_wid ) ), None) if close_report: diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 9a0264585..175aaa1de 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -31,7 +31,7 @@ def pytest_addoption(parser): parser.addoption('--runpytest', default="inprocess", dest="runpytest", choices=("inprocess", "subprocess", ), help=("run pytest sub runs in tests using an 'inprocess' " - "or 'subprocess' (python -m main) method")) + "or 'subprocess' (python -m main) method")) def pytest_configure(config): diff --git a/_pytest/python.py b/_pytest/python.py index 0f49a07f9..72084cb47 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -904,7 +904,7 @@ def _find_parametrized_scope(argnames, arg2fixturedefs, indirect): from _pytest.fixtures import scopes indirect_as_list = isinstance(indirect, (list, tuple)) all_arguments_are_fixtures = indirect is True or \ - indirect_as_list and len(indirect) == argnames + indirect_as_list and len(indirect) == argnames if all_arguments_are_fixtures: fixturedefs = arg2fixturedefs or {} used_scopes = [fixturedef[0].scope for name, fixturedef in fixturedefs.items()] diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 7da68e598..9e32adf22 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -339,7 +339,7 @@ def test_excinfo_no_python_sourcecode(tmpdir): env = jinja2.Environment(loader=loader) template = env.get_template('test.txt') excinfo = pytest.raises(ValueError, - template.render, h=h) + template.render, h=h) for item in excinfo.traceback: print(item) #XXX: for some reason jinja.Template.render is printed in full item.source # shouldnt fail diff --git a/testing/python/integration.py b/testing/python/integration.py index 4f888276b..c346b93be 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -173,7 +173,7 @@ class TestMockDecoration(object): reprec.assertoutcome(passed=2) calls = reprec.getcalls("pytest_runtest_logreport") funcnames = [call.report.location[2] for call in calls - if call.report.when == "call"] + if call.report.when == "call"] assert funcnames == ["T.test_hello", "test_someting"] def test_mock_sorting(self, testdir): diff --git a/testing/test_collection.py b/testing/test_collection.py index a90269789..6dcb7eda2 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -460,7 +460,7 @@ class TestSession(object): ("pytest_collectstart", "collector.fspath == test_aaa"), ("pytest_pycollect_makeitem", "name == 'test_func'"), ("pytest_collectreport", - "report.nodeid.startswith('aaa/test_aaa.py')"), + "report.nodeid.startswith('aaa/test_aaa.py')"), ]) def test_collect_two_commandline_args(self, testdir): diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index 38542783a..f17519d8d 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -188,7 +188,7 @@ class TestParser(object): def test_drop_short_helper(self): parser = py.std.argparse.ArgumentParser(formatter_class=parseopt.DropShorterLongHelpFormatter) parser.add_argument('-t', '--twoword', '--duo', '--two-word', '--two', - help='foo').map_long_option = {'two': 'two-word'} + help='foo').map_long_option = {'two': 'two-word'} # throws error on --deux only! parser.add_argument('-d', '--deuxmots', '--deux-mots', action='store_true', help='foo').map_long_option = {'deux': 'deux-mots'} diff --git a/tox.ini b/tox.ini index f2c82ad18..6b6d060b7 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = E127,E128,E129,E131,E201,E202,E203,E221,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731 +ignore = E128,E129,E131,E201,E202,E203,E221,E222,E225,E226,E231,E241,E251,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