diff --git a/_pytest/_code/_py2traceback.py b/_pytest/_code/_py2traceback.py index d45ee01fa..5c4f5ff22 100644 --- a/_pytest/_code/_py2traceback.py +++ b/_pytest/_code/_py2traceback.py @@ -30,7 +30,7 @@ def format_exception_only(etype, value): # would throw another exception and mask the original problem. if (isinstance(etype, BaseException) or isinstance(etype, types.InstanceType) or - etype is None or type(etype) is str): + etype is None or type(etype) is str): return [_format_final_exc_line(etype, value)] stype = etype.__name__ diff --git a/_pytest/_code/code.py b/_pytest/_code/code.py index 49c300b30..29f046e61 100644 --- a/_pytest/_code/code.py +++ b/_pytest/_code/code.py @@ -289,7 +289,7 @@ class Traceback(list): (excludepath is None or not hasattr(codepath, 'relto') or not codepath.relto(excludepath)) and (lineno is None or x.lineno == lineno) and - (firstlineno is None or x.frame.code.firstlineno == firstlineno)): + (firstlineno is None or x.frame.code.firstlineno == firstlineno)): return Traceback(x._rawentry, self._excinfo) return self diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index 1849d9cba..95cc217d4 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -307,7 +307,7 @@ def _rewrite_test(config, fn): end2 = source.find("\n", end1 + 1) if (not source.startswith(BOM_UTF8) and cookie_re.match(source[0:end1]) is None and - cookie_re.match(source[end1 + 1:end2]) is None): + cookie_re.match(source[end1 + 1:end2]) is None): if hasattr(state, "_indecode"): # encodings imported us again, so don't rewrite. return None, None diff --git a/_pytest/unittest.py b/_pytest/unittest.py index 64cb5f5ee..3c473c6bd 100644 --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -158,7 +158,7 @@ class TestCaseFunction(Function): # analog to pythons Lib/unittest/case.py:run testMethod = getattr(self._testcase, self._testcase._testMethodName) if (getattr(self._testcase.__class__, "__unittest_skip__", False) or - getattr(testMethod, "__unittest_skip__", False)): + getattr(testMethod, "__unittest_skip__", False)): # If the class or method was skipped. skip_why = (getattr(self._testcase.__class__, '__unittest_skip_why__', '') or getattr(testMethod, '__unittest_skip_why__', '')) diff --git a/tox.ini b/tox.ini index fe6ec332a..2ea365605 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = 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 = 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