From 8f3eb6dfc7d5e9ceca694ccf2c4906bbea969faf Mon Sep 17 00:00:00 2001 From: Andras Tim Date: Mon, 17 Jul 2017 01:25:09 +0200 Subject: [PATCH] Fixed E261 flake8 errors at least two spaces before inline comment --- _pytest/_argcomplete.py | 2 +- _pytest/_code/source.py | 8 ++++---- _pytest/assertion/rewrite.py | 8 ++++---- _pytest/capture.py | 2 +- _pytest/config.py | 8 ++++---- _pytest/fixtures.py | 4 ++-- _pytest/main.py | 6 +++--- _pytest/mark.py | 2 +- _pytest/pytester.py | 8 ++++---- _pytest/python.py | 2 +- _pytest/resultlog.py | 4 ++-- _pytest/runner.py | 4 ++-- _pytest/terminal.py | 6 +++--- testing/acceptance_test.py | 6 +++--- testing/code/test_excinfo.py | 12 ++++++------ testing/code/test_source.py | 4 ++-- testing/python/collect.py | 4 ++-- testing/python/fixture.py | 2 +- testing/python/integration.py | 4 ++-- testing/test_assertion.py | 2 +- testing/test_assertrewrite.py | 2 +- testing/test_pdb.py | 8 ++++---- testing/test_resultlog.py | 2 +- testing/test_runner.py | 4 ++-- testing/test_session.py | 4 ++-- testing/test_skipping.py | 2 +- testing/test_terminal.py | 2 +- tox.ini | 2 +- 28 files changed, 62 insertions(+), 62 deletions(-) diff --git a/_pytest/_argcomplete.py b/_pytest/_argcomplete.py index 8c93e4c92..e86585591 100644 --- a/_pytest/_argcomplete.py +++ b/_pytest/_argcomplete.py @@ -69,7 +69,7 @@ class FastFilesCompleter: def __call__(self, prefix, **kwargs): """only called on non option completions""" - if os.path.sep in prefix[1:]: # + if os.path.sep in prefix[1:]: prefix_dir = len(os.path.dirname(prefix) + os.path.sep) else: prefix_dir = 0 diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py index f86d96c9c..e4c18eb34 100644 --- a/_pytest/_code/source.py +++ b/_pytest/_code/source.py @@ -164,7 +164,7 @@ class Source(object): """ if not filename or py.path.local(filename).check(file=0): if _genframe is None: - _genframe = sys._getframe(1) # the caller + _genframe = sys._getframe(1) # the caller fn, lineno = _genframe.f_code.co_filename, _genframe.f_lineno base = "<%d-codegen " % self._compilecounter self.__class__._compilecounter += 1 @@ -207,7 +207,7 @@ def compile_(source, filename=None, mode='exec', flags=generators.compiler_flag, if _ast is not None and isinstance(source, _ast.AST): # XXX should Source support having AST? return cpy_compile(source, filename, mode, flags, dont_inherit) - _genframe = sys._getframe(1) # the caller + _genframe = sys._getframe(1) # the caller s = Source(source) co = s.compile(filename, mode, flags, _genframe=_genframe) return co @@ -292,11 +292,11 @@ def deindent(lines, offset=None): try: for _, _, (sline, _), (eline, _), _ in tokenize.generate_tokens(lambda: next(it)): if sline > len(lines): - break # End of input reached + break # End of input reached if sline > len(newlines): line = lines[sline - 1].expandtabs() if line.lstrip() and line[:offset].isspace(): - line = line[offset:] # Deindent + line = line[offset:] # Deindent newlines.append(line) for i in range(sline, eline): diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index 1ae41bd14..bce04398b 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -410,7 +410,7 @@ def _saferepr(obj): return repr.replace(t("\n"), t("\\n")) -from _pytest.assertion.util import format_explanation as _format_explanation # noqa +from _pytest.assertion.util import format_explanation as _format_explanation # noqa def _format_assertmsg(obj): """Format the custom assertion message given. @@ -483,7 +483,7 @@ binop_map = { ast.Mult: "*", ast.Div: "/", ast.FloorDiv: "//", - ast.Mod: "%%", # escaped for string formatting + ast.Mod: "%%", # escaped for string formatting ast.Eq: "==", ast.NotEq: "!=", ast.Lt: "<", @@ -787,7 +787,7 @@ class AssertionRewriter(ast.NodeVisitor): if i: fail_inner = [] # cond is set in a prior loop iteration below - self.on_failure.append(ast.If(cond, fail_inner, [])) # noqa + self.on_failure.append(ast.If(cond, fail_inner, [])) # noqa self.on_failure = fail_inner self.push_format_context() res, expl = self.visit(v) @@ -839,7 +839,7 @@ class AssertionRewriter(ast.NodeVisitor): new_kwargs.append(ast.keyword(keyword.arg, res)) if keyword.arg: arg_expls.append(keyword.arg + "=" + expl) - else: ## **args have `arg` keywords with an .arg of None + else: # **args have `arg` keywords with an .arg of None arg_expls.append("**" + expl) expl = "%s(%s)" % (func_expl, ', '.join(arg_expls)) diff --git a/_pytest/capture.py b/_pytest/capture.py index 1231ae825..1bcb97e9b 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -393,7 +393,7 @@ class FDCapture: def writeorg(self, data): """ write to original file descriptor. """ if py.builtin._istext(data): - data = data.encode("utf8") # XXX use encoding of original stream + data = data.encode("utf8") # XXX use encoding of original stream os.write(self.targetfd_save, data) diff --git a/_pytest/config.py b/_pytest/config.py index 68da9c342..b63fc2506 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -315,7 +315,7 @@ class PytestPluginManager(PluginManager): if i != -1: path = path[:i] anchor = current.join(path, abs=1) - if exists(anchor): # we found some file object + if exists(anchor): # we found some file object self._try_load_conftest(anchor) foundanchor = True if not foundanchor: @@ -807,7 +807,7 @@ class DropShorterLongHelpFormatter(argparse.HelpFormatter): """ def _format_action_invocation(self, action): orgstr = argparse.HelpFormatter._format_action_invocation(self, action) - if orgstr and orgstr[0] != '-': # only optional arguments + if orgstr and orgstr[0] != '-': # only optional arguments return orgstr res = getattr(action, '_formatted_action_invocation', None) if res: @@ -836,7 +836,7 @@ class DropShorterLongHelpFormatter(argparse.HelpFormatter): short_long[shortened] = xxoption # now short_long has been filled out to the longest with dashes # **and** we keep the right option ordering from add_argument - for option in options: # + for option in options: if len(option) == 2 or option[2] == ' ': return_list.append(option) if option[2:] == short_long.get(option.replace('-', '')): @@ -1125,7 +1125,7 @@ class Config(object): the first line in its value. """ x = self.getini(name) assert isinstance(x, list) - x.append(line) # modifies the cached list inline + x.append(line) # modifies the cached list inline def getini(self, name): """ return configuration value from an :ref:`ini file `. If the diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index 12d7bbb83..893043d89 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -69,7 +69,7 @@ def add_funcarg_pseudo_fixture_def(collector, metafunc, fixturemanager): # XXX we can probably avoid this algorithm if we modify CallSpec2 # to directly care for creating the fixturedefs within its methods. if not metafunc._calls[0].funcargs: - return # this function call does not have direct parametrization + return # this function call does not have direct parametrization # collect funcargs of all callspecs into a list of values arg2params = {} arg2scope = {} @@ -397,7 +397,7 @@ class FixtureRequest(FuncargnamesCompatAttr): :arg extrakey: added to internal caching key of (funcargname, scope). """ if not hasattr(self.config, '_setupcache'): - self.config._setupcache = {} # XXX weakref? + self.config._setupcache = {} # XXX weakref? cachekey = (self.fixturename, self._getscopeitem(scope), extrakey) cache = self.config._setupcache try: diff --git a/_pytest/main.py b/_pytest/main.py index 74acc409d..86c5bc5b1 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -88,7 +88,7 @@ def pytest_namespace(): def pytest_configure(config): - __import__('pytest').config = config # compatibiltiy + __import__('pytest').config = config # compatibiltiy def wrap_session(config, doit): @@ -488,7 +488,7 @@ class Collector(Node): class FSCollector(Collector): def __init__(self, fspath, parent=None, config=None, session=None): - fspath = py.path.local(fspath) # xxx only for test_resultlog.py? + fspath = py.path.local(fspath) # xxx only for test_resultlog.py? name = fspath.basename if parent is not None: rel = fspath.relto(parent.fspath) @@ -561,7 +561,7 @@ class NoMatch(Exception): class Interrupted(KeyboardInterrupt): """ signals an interrupted test run. """ - __module__ = 'builtins' # for py3 + __module__ = 'builtins' # for py3 class Session(FSCollector): Interrupted = Interrupted diff --git a/_pytest/mark.py b/_pytest/mark.py index 8b40a4f6e..ce48dd0f1 100644 --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -313,7 +313,7 @@ class MarkDecorator: @property def markname(self): - return self.name # for backward-compat (2.4.1 had this attr) + return self.name # for backward-compat (2.4.1 had this attr) def __eq__(self, other): return self.mark == other.mark diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 46a273dbb..bf139aa4c 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -136,7 +136,7 @@ def getexecutable(name, cache={}): if not err or "2.5" not in err: executable = None if "2.5.2" in err: - executable = None # http://bugs.jython.org/issue1790 + executable = None # http://bugs.jython.org/issue1790 elif popen.returncode != 0: # Handle pyenv's 127. executable = None @@ -420,7 +420,7 @@ class Testdir: self.plugins = [] self._savesyspath = (list(sys.path), list(sys.meta_path)) self._savemodulekeys = set(sys.modules) - self.chdir() # always chdir + self.chdir() # always chdir self.request.addfinalizer(self.finalize) method = self.request.config.getoption("--runpytest") if method == "inprocess": @@ -495,7 +495,7 @@ class Testdir: source_unicode = "\n".join([my_totext(line) for line in source.lines]) source = py.builtin._totext(source_unicode) - content = source.strip().encode(encoding) # + "\n" + content = source.strip().encode(encoding) # + "\n" #content = content.rstrip() + "\n" p.write(content, "wb") if ret is None: @@ -960,7 +960,7 @@ class Testdir: def _getpytestargs(self): # we cannot use "(sys.executable,script)" # because on windows the script is e.g. a pytest.exe - return (sys.executable, _pytest_fullpath,) # noqa + return (sys.executable, _pytest_fullpath,) # noqa def runpython(self, script): """Run a python script using sys.executable as interpreter. diff --git a/_pytest/python.py b/_pytest/python.py index 56ad8ea3e..a7c7a9f35 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1574,7 +1574,7 @@ class Function(FunctionMixin, main.Item, fixtures.FuncargnamesCompatAttr): def _getobj(self): name = self.name - i = name.find("[") # parametrization + i = name.find("[") # parametrization if i != -1: name = name[:i] return getattr(self.parent.obj, name) diff --git a/_pytest/resultlog.py b/_pytest/resultlog.py index 615575aa0..93523038a 100644 --- a/_pytest/resultlog.py +++ b/_pytest/resultlog.py @@ -19,7 +19,7 @@ def pytest_configure(config): dirname = os.path.dirname(os.path.abspath(resultlog)) if not os.path.isdir(dirname): os.makedirs(dirname) - logfile = open(resultlog, 'w', 1) # line buffered + logfile = open(resultlog, 'w', 1) # line buffered config._resultlog = ResultLog(config, logfile) config.pluginmanager.register(config._resultlog) @@ -59,7 +59,7 @@ def generic_path(item): class ResultLog(object): def __init__(self, config, logfile): self.config = config - self.logfile = logfile # preferably line buffered + self.logfile = logfile # preferably line buffered def write_log_entry(self, testpath, lettercode, longrepr): print("%s %s" % (lettercode, testpath), file=self.logfile) diff --git a/_pytest/runner.py b/_pytest/runner.py index 21401e92b..9d1f53a57 100644 --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -264,7 +264,7 @@ def pytest_runtest_makereport(item, call): outcome = "failed" if call.when == "call": longrepr = item.repr_failure(excinfo) - else: # exception in setup or teardown + else: # exception in setup or teardown longrepr = item._repr_failure_py(excinfo, style=item.config.option.tbstyle) for rwhen, key, content in item._report_sections: @@ -548,7 +548,7 @@ def importorskip(modname, minversion=None): """ import warnings __tracebackhide__ = True - compile(modname, '', 'eval') # to catch syntaxerrors + compile(modname, '', 'eval') # to catch syntaxerrors should_skip = False with warnings.catch_warnings(): diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 55e57b97a..52003c5fd 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -371,7 +371,7 @@ class TerminalReporter: stack = [] indent = "" for item in items: - needed_collectors = item.listchain()[1:] # strip root node + needed_collectors = item.listchain()[1:] # strip root node while stack: if stack == needed_collectors[:len(stack)]: break @@ -446,7 +446,7 @@ class TerminalReporter: fspath, lineno, domain = rep.location return domain else: - return "test session" # XXX? + return "test session" # XXX? def _getcrashline(self, rep): try: @@ -589,7 +589,7 @@ def build_summary_stats_line(stats): unknown_key_seen = False for key in stats.keys(): if key not in keys: - if key: # setup/teardown reports have an empty key, ignore them + if key: # setup/teardown reports have an empty key, ignore them keys.append(key) unknown_key_seen = True parts = [] diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 9ea200b12..e1a2956a3 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -74,7 +74,7 @@ class TestGeneralUsage(object): print("---unconfigure") """) result = testdir.runpytest("-s", "asd") - assert result.ret == 4 # EXIT_USAGEERROR + assert result.ret == 4 # EXIT_USAGEERROR result.stderr.fnmatch_lines(["ERROR: file not found*asd"]) result.stdout.fnmatch_lines([ "*---configure", @@ -310,7 +310,7 @@ class TestGeneralUsage(object): x """) result = testdir.runpytest() - assert result.ret == 3 # internal error + assert result.ret == 3 # internal error result.stderr.fnmatch_lines([ "INTERNAL*pytest_configure*", "INTERNAL*x*", @@ -719,7 +719,7 @@ class TestDurations(object): result = testdir.runpytest("--durations=0") assert result.ret == 0 for x in "123": - for y in 'call', : #'setup', 'call', 'teardown': + for y in 'call', : # 'setup', 'call', 'teardown': for line in result.stdout.lines: if ("test_%s" % x) in line and y in line: break diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 2eb340fae..a042e14bd 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -101,8 +101,8 @@ class TestTraceback_f_g_h(object): def test_traceback_entries(self): tb = self.excinfo.traceback entries = list(tb) - assert len(tb) == 4 # maybe fragile test - assert len(entries) == 4 # maybe fragile test + assert len(tb) == 4 # maybe fragile test + assert len(entries) == 4 # maybe fragile test names = ['f', 'g', 'h'] for entry in entries: try: @@ -311,9 +311,9 @@ def test_excinfo_repr(): def test_excinfo_str(): excinfo = pytest.raises(ValueError, h) s = str(excinfo) - assert s.startswith(__file__[:-9]) # pyc file and $py.class + assert s.startswith(__file__[:-9]) # pyc file and $py.class assert s.endswith("ValueError") - assert len(s.split(":")) >= 3 # on windows it's 4 + assert len(s.split(":")) >= 3 # on windows it's 4 def test_excinfo_errisinstance(): excinfo = pytest.raises(ValueError, h) @@ -341,8 +341,8 @@ def test_excinfo_no_python_sourcecode(tmpdir): excinfo = pytest.raises(ValueError, 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 + print(item) # XXX: for some reason jinja.Template.render is printed in full + item.source # shouldnt fail if item.path.basename == 'test.txt': assert str(item.source) == '{{ h()}}:' diff --git a/testing/code/test_source.py b/testing/code/test_source.py index f12b8a1a1..c9ce42147 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -109,7 +109,7 @@ def test_source_strip_multiline(): def test_syntaxerror_rerepresentation(): ex = pytest.raises(SyntaxError, _pytest._code.compile, 'xyz xyz') assert ex.value.lineno == 1 - assert ex.value.offset in (4, 7) # XXX pypy/jython versus cpython? + assert ex.value.offset in (4, 7) # XXX pypy/jython versus cpython? assert ex.value.text.strip(), 'x x' def test_isparseable(): @@ -451,7 +451,7 @@ def test_getfslineno(): fspath, lineno = getfslineno(f) assert fspath.basename == "test_source.py" - assert lineno == _pytest._code.getrawcode(f).co_firstlineno - 1 # see findsource + assert lineno == _pytest._code.getrawcode(f).co_firstlineno - 1 # see findsource class A(object): pass diff --git a/testing/python/collect.py b/testing/python/collect.py index eeae5bc16..9e9753bf0 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -923,13 +923,13 @@ class TestTracebackCutting(object): out = result.stdout.str() assert "xyz" in out assert "conftest.py:5: ValueError" in out - numentries = out.count("_ _ _") # separator for traceback entries + numentries = out.count("_ _ _") # separator for traceback entries assert numentries == 0 result = testdir.runpytest("--fulltrace", p) out = result.stdout.str() assert "conftest.py:5: ValueError" in out - numentries = out.count("_ _ _ _") # separator for traceback entries + numentries = out.count("_ _ _ _") # separator for traceback entries assert numentries > 3 def test_traceback_error_during_import(self, testdir): diff --git a/testing/python/fixture.py b/testing/python/fixture.py index 8d1d67959..33fa4ba96 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -44,7 +44,7 @@ class TestFillFixtures(object): def test_func(some): pass """) - result = testdir.runpytest() # "--collect-only") + result = testdir.runpytest() # "--collect-only") assert result.ret != 0 result.stdout.fnmatch_lines([ "*def test_func(some)*", diff --git a/testing/python/integration.py b/testing/python/integration.py index c346b93be..6acc3de7c 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -4,7 +4,7 @@ from _pytest import runner class TestOEJSKITSpecials(object): - def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage + def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage testdir.makeconftest(""" import pytest def pytest_pycollect_makeitem(collector, name, obj): @@ -30,7 +30,7 @@ class TestOEJSKITSpecials(object): pytest._fillfuncargs(clscol) assert clscol.funcargs['arg1'] == 42 - def test_autouse_fixture(self, testdir): # rough jstests usage + def test_autouse_fixture(self, testdir): # rough jstests usage testdir.makeconftest(""" import pytest def pytest_pycollect_makeitem(collector, name, obj): diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 086006545..c6af5c1cc 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -831,7 +831,7 @@ def test_traceback_failure(testdir): "*test_traceback_failure.py:4: AssertionError" ]) - result = testdir.runpytest(p1) # "auto" + result = testdir.runpytest(p1) # "auto" result.stdout.fnmatch_lines([ "*test_traceback_failure.py F", "====* FAILURES *====", diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 73beaf02a..66af5414e 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -401,7 +401,7 @@ class TestAssertionRewrite(object): ns = {"x": X} def f(): - assert not x.g # noqa + assert not x.g # noqa assert getmsg(f, ns) == """assert not 3 + where 3 = x.g""" diff --git a/testing/test_pdb.py b/testing/test_pdb.py index 5429dd5d4..2445c807c 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -10,7 +10,7 @@ def runpdb_and_get_report(testdir, source): p = testdir.makepyfile(source) result = testdir.runpytest_inprocess("--pdb", p) reports = result.reprec.getreports("pytest_runtest_logreport") - assert len(reports) == 3, reports # setup/call/teardown + assert len(reports) == 3, reports # setup/call/teardown return reports[1] @@ -216,7 +216,7 @@ class TestPDB(object): rest = child.read().decode("utf-8") assert "1 failed" in rest assert "def test_1" in rest - assert "hello17" in rest # out is captured + assert "hello17" in rest # out is captured self.flush(child) def test_pdb_set_trace_interception(self, testdir): @@ -309,8 +309,8 @@ class TestPDB(object): rest = child.read().decode("utf8") assert "1 failed" in rest assert "def test_1" in rest - assert "hello17" in rest # out is captured - assert "hello18" in rest # out is captured + assert "hello17" in rest # out is captured + assert "hello18" in rest # out is captured self.flush(child) def test_pdb_used_outside_test(self, testdir): diff --git a/testing/test_resultlog.py b/testing/test_resultlog.py index 7bbaa458c..c5416fa03 100644 --- a/testing/test_resultlog.py +++ b/testing/test_resultlog.py @@ -144,7 +144,7 @@ class TestWithFunctionIntegration(object): assert entry_lines[0].startswith('! ') if style != "native": - assert os.path.basename(__file__)[:-9] in entry_lines[0] #.pyc/class + assert os.path.basename(__file__)[:-9] in entry_lines[0] # .pyc/class assert entry_lines[-1][0] == ' ' assert 'ValueError' in entry diff --git a/testing/test_runner.py b/testing/test_runner.py index efaab1993..5fb96d008 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -31,7 +31,7 @@ class TestSetupState(object): def setup_module(mod): raise ValueError(42) def test_func(): pass - """) # noqa + """) # noqa ss = runner.SetupState() pytest.raises(ValueError, lambda: ss.prepare(item)) pytest.raises(ValueError, lambda: ss.prepare(item)) @@ -131,7 +131,7 @@ class BaseFunctionalTests(object): #assert rep.skipped.location.lineno == 3 #assert rep.skipped.location.lineno == 3 assert len(reports) == 2 - assert reports[1].passed # teardown + assert reports[1].passed # teardown def test_failure_in_setup_function(self, testdir): reports = testdir.runitem(""" diff --git a/testing/test_session.py b/testing/test_session.py index d08f7b3e2..1cb0bb285 100644 --- a/testing/test_session.py +++ b/testing/test_session.py @@ -117,7 +117,7 @@ class SessionTests(object): passed, skipped, failed = reprec.listoutcomes() assert len(failed) == 1 out = failed[0].longrepr.reprcrash.message - assert out.find("""[Exception("Ha Ha fooled you, I'm a broken repr().") raised in repr()]""") != -1 #' + assert out.find("""[Exception("Ha Ha fooled you, I'm a broken repr().") raised in repr()]""") != -1 # ' def test_skip_file_by_conftest(self, testdir): testdir.makepyfile(conftest=""" @@ -186,7 +186,7 @@ class TestNewSession(SessionTests): started = reprec.getcalls("pytest_collectstart") finished = reprec.getreports("pytest_collectreport") assert len(started) == len(finished) - assert len(started) == 7 # XXX extra TopCollector + assert len(started) == 7 # XXX extra TopCollector colfail = [x for x in finished if x.failed] assert len(colfail) == 1 diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 7e101f88c..cfd1af684 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -589,7 +589,7 @@ class TestSkipif(object): @pytest.mark.skipif("hasattr(os, 'sep')") def test_func(): pass - """) # noqa + """) # noqa x = pytest.raises(pytest.skip.Exception, lambda: pytest_runtest_setup(item)) assert x.value.msg == "condition: hasattr(os, 'sep')" diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 66e909fe1..5f554f7f6 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -318,7 +318,7 @@ def test_repr_python_version(monkeypatch): py.std.sys.version_info = x = (2, 3) assert repr_pythonversion() == str(x) finally: - monkeypatch.undo() # do this early as pytest can get confused + monkeypatch.undo() # do this early as pytest can get confused class TestFixtureReporting(object): def test_setup_fixture_error(self, testdir): diff --git a/tox.ini b/tox.ini index 68302e315..768439fe8 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731 +ignore = 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