diff --git a/_pytest/_code/code.py b/_pytest/_code/code.py index 2f5e56079..92d7d5b0c 100644 --- a/_pytest/_code/code.py +++ b/_pytest/_code/code.py @@ -330,9 +330,9 @@ class Traceback(list): # id for the code.raw is needed to work around # the strange metaprogramming in the decorator lib from pypi # which generates code objects that have hash/value equality - #XXX needs a test + # XXX needs a test key = entry.frame.code.path, id(entry.frame.code.raw), entry.lineno - #print "checking for recursion at", key + # print "checking for recursion at", key l = cache.setdefault(key, []) if l: f = entry.frame @@ -546,10 +546,10 @@ class FormattedExcinfo(object): # _repr() function, which is only reprlib.Repr in # disguise, so is very configurable. str_repr = self._saferepr(value) - #if len(str_repr) < 70 or not isinstance(value, + # if len(str_repr) < 70 or not isinstance(value, # (list, tuple, dict)): lines.append("%-10s = %s" % (name, str_repr)) - #else: + # else: # self._line("%-10s =\\" % (name,)) # # XXX # py.std.pprint.pprint(value, stream=self.excinfowriter) @@ -797,7 +797,7 @@ class ReprEntry(TerminalRepr): for line in self.lines: red = line.startswith("E ") tw.line(line, bold=True, red=red) - #tw.line("") + # tw.line("") return if self.reprfuncargs: self.reprfuncargs.toterminal(tw) @@ -805,7 +805,7 @@ class ReprEntry(TerminalRepr): red = line.startswith("E ") tw.line(line, bold=True, red=red) if self.reprlocals: - #tw.sep(self.localssep, "Locals") + # tw.sep(self.localssep, "Locals") tw.line("") self.reprlocals.toterminal(tw) if self.reprfileloc: diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py index e4c18eb34..08b9c414d 100644 --- a/_pytest/_code/source.py +++ b/_pytest/_code/source.py @@ -143,7 +143,7 @@ class Source(object): else: source = str(self) try: - #compile(source+'\n', "x", "exec") + # compile(source+'\n', "x", "exec") syntax_checker(source + '\n') except KeyboardInterrupt: raise diff --git a/_pytest/cacheprovider.py b/_pytest/cacheprovider.py index de3fa4589..4573fd462 100755 --- a/_pytest/cacheprovider.py +++ b/_pytest/cacheprovider.py @@ -236,7 +236,7 @@ def cacheshow(config, session): if ddir.isdir() and ddir.listdir(): tw.sep("-", "cache directories") for p in sorted(basedir.join("d").visit()): - #if p.check(dir=1): + # if p.check(dir=1): # print("%s/" % p.relto(basedir)) if p.isfile(): key = p.relto(basedir) diff --git a/_pytest/capture.py b/_pytest/capture.py index 1bcb97e9b..56e03bba8 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -134,7 +134,7 @@ class CaptureManager: self.resumecapture() self.activate_funcargs(item) yield - #self.deactivate_funcargs() called from suspendcapture() + # self.deactivate_funcargs() called from suspendcapture() self.suspendcapture_item(item, "call") @pytest.hookimpl(hookwrapper=True) diff --git a/_pytest/compat.py b/_pytest/compat.py index d89c2922f..4fac998e8 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -85,7 +85,7 @@ def num_mock_patch_args(function): def getfuncargnames(function, startindex=None): # XXX merge with main.py's varnames - #assert not isclass(function) + # assert not isclass(function) realfunction = function while hasattr(realfunction, "__wrapped__"): realfunction = realfunction.__wrapped__ diff --git a/_pytest/config.py b/_pytest/config.py index b63fc2506..7285d3d0a 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -693,7 +693,7 @@ class Argument: if self._attrs.get('help'): a = self._attrs['help'] a = a.replace('%default', '%(default)s') - #a = a.replace('%prog', '%(prog)s') + # a = a.replace('%prog', '%(prog)s') self._attrs['help'] = a return self._attrs @@ -1361,7 +1361,7 @@ def setns(obj, dic): else: setattr(obj, name, value) obj.__all__.append(name) - #if obj != pytest: + # if obj != pytest: # pytest.__all__.append(name) setattr(pytest, name, value) diff --git a/_pytest/main.py b/_pytest/main.py index 86c5bc5b1..5460b537e 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -32,11 +32,11 @@ def pytest_addoption(parser): type="args", default=['.*', 'build', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv']) parser.addini("testpaths", "directories to search for tests when no files or directories are given in the command line.", type="args", default=[]) - #parser.addini("dirpatterns", + # parser.addini("dirpatterns", # "patterns specifying possible locations of test files", # type="linelist", default=["**/test_*.txt", # "**/test_*.py", "**/*_test.py"] - #) + # ) group = parser.getgroup("general", "running and selection options") group._addoption('-x', '--exitfirst', action="store_const", dest="maxfail", const=1, diff --git a/_pytest/nose.py b/_pytest/nose.py index 9d4fc0b6e..f21e39673 100644 --- a/_pytest/nose.py +++ b/_pytest/nose.py @@ -38,14 +38,14 @@ def pytest_runtest_setup(item): if not call_optional(item.obj, 'setup'): # call module level setup if there is no object level one call_optional(item.parent.obj, 'setup') - #XXX this implies we only call teardown when setup worked + # XXX this implies we only call teardown when setup worked item.session._setupstate.addfinalizer((lambda: teardown_nose(item)), item) def teardown_nose(item): if is_potential_nosetest(item): if not call_optional(item.obj, 'teardown'): call_optional(item.parent.obj, 'teardown') - #if hasattr(item.parent, '_nosegensetup'): + # if hasattr(item.parent, '_nosegensetup'): # #call_optional(item._nosegensetup, 'teardown') # del item.parent._nosegensetup diff --git a/_pytest/pytester.py b/_pytest/pytester.py index bf139aa4c..0ea4d6c44 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -496,7 +496,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 = content.rstrip() + "\n" + # content = content.rstrip() + "\n" p.write(content, "wb") if ret is None: ret = p @@ -779,11 +779,11 @@ class Testdir: args = [str(x) for x in args] for x in args: if str(x).startswith('--basetemp'): - #print ("basedtemp exists: %s" %(args,)) + # print("basedtemp exists: %s" %(args,)) break else: args.append("--basetemp=%s" % self.tmpdir.dirpath('basetemp')) - #print ("added basetemp: %s" %(args,)) + # print("added basetemp: %s" %(args,)) return args def parseconfig(self, *args): @@ -989,10 +989,10 @@ class Testdir: p = py.path.local.make_numbered_dir(prefix="runpytest-", keep=None, rootdir=self.tmpdir) args = ('--basetemp=%s' % p, ) + args - #for x in args: + # for x in args: # if '--confcutdir' in str(x): # break - #else: + # else: # pass # args = ('--confcutdir=.',) + args plugins = [x for x in self.plugins if isinstance(x, str)] diff --git a/_pytest/python.py b/_pytest/python.py index a7c7a9f35..9b6c5a39b 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -320,7 +320,7 @@ class PyCollector(PyobjMixin, main.Collector): return l def makeitem(self, name, obj): - #assert self.ihook.fspath == self.fspath, self + # assert self.ihook.fspath == self.fspath, self return self.ihook.pytest_pycollect_makeitem( collector=self, name=name, obj=obj) @@ -563,7 +563,7 @@ class FunctionMixin(PyobjMixin): if ntraceback == traceback: ntraceback = ntraceback.cut(path=path) if ntraceback == traceback: - #ntraceback = ntraceback.cut(excludepath=cutdir2) + # ntraceback = ntraceback.cut(excludepath=cutdir2) ntraceback = ntraceback.filter(filter_traceback) if not ntraceback: ntraceback = traceback @@ -1213,7 +1213,7 @@ def raises(expected_exception, *args, **kwargs): frame = sys._getframe(1) loc = frame.f_locals.copy() loc.update(kwargs) - #print "raises frame scope: %r" % frame.f_locals + # print "raises frame scope: %r" % frame.f_locals try: code = _pytest._code.Source(code).compile() py.builtin.exec_(code, frame.f_globals, loc) diff --git a/_pytest/runner.py b/_pytest/runner.py index 9d1f53a57..8c101557b 100644 --- a/_pytest/runner.py +++ b/_pytest/runner.py @@ -386,7 +386,7 @@ class SetupState(object): """ assert colitem and not isinstance(colitem, tuple) assert py.builtin.callable(finalizer) - #assert colitem in self.stack # some unit tests don't setup stack :/ + # assert colitem in self.stack # some unit tests don't setup stack :/ self._finalizers.setdefault(colitem, []).append(finalizer) def _pop_and_teardown(self): diff --git a/_pytest/skipping.py b/_pytest/skipping.py index 2aafa1418..56b361660 100644 --- a/_pytest/skipping.py +++ b/_pytest/skipping.py @@ -280,7 +280,7 @@ def pytest_report_teststatus(report): def pytest_terminal_summary(terminalreporter): tr = terminalreporter if not tr.reportchars: - #for name in "xfailed skipped failed xpassed": + # for name in "xfailed skipped failed xpassed": # if not tr.stats.get(name, 0): # tr.write_line("HINT: use '-r' option to see extra " # "summary info about tests") @@ -364,14 +364,14 @@ def show_skipped(terminalreporter, lines): tr = terminalreporter skipped = tr.stats.get('skipped', []) if skipped: - #if not tr.hasopt('skipped'): + # if not tr.hasopt('skipped'): # tr.write_line( # "%d skipped tests, specify -rs for more info" % # len(skipped)) # return fskips = folded_skips(skipped) if fskips: - #tr.write_sep("_", "skipped test summary") + # tr.write_sep("_", "skipped test summary") for num, fspath, lineno, reason in fskips: if reason.startswith("Skipped: "): reason = reason[9:] diff --git a/_pytest/terminal.py b/_pytest/terminal.py index 52003c5fd..f0bf996f3 100644 --- a/_pytest/terminal.py +++ b/_pytest/terminal.py @@ -248,7 +248,7 @@ class TerminalReporter: line = self._locationline(rep.nodeid, *rep.location) if not hasattr(rep, 'node'): self.write_ensure_prefix(line, word, **markup) - #self._tw.write(word, **markup) + # self._tw.write(word, **markup) else: self.ensure_newline() if hasattr(rep, 'node'): @@ -269,7 +269,7 @@ class TerminalReporter: items = [x for x in report.result if isinstance(x, pytest.Item)] self._numcollected += len(items) if self.isatty: - #self.write_fspath_result(report.nodeid, 'E') + # self.write_fspath_result(report.nodeid, 'E') self.report_collect() def report_collect(self, final=False): @@ -347,7 +347,7 @@ class TerminalReporter: return 0 if not self.showheader: return - #for i, testarg in enumerate(self.config.args): + # for i, testarg in enumerate(self.config.args): # self.write_line("test path %d: %s" %(i+1, testarg)) def _printcollecteditems(self, items): @@ -378,7 +378,7 @@ class TerminalReporter: stack.pop() for col in needed_collectors[len(stack):]: stack.append(col) - #if col.name == "()": + # if col.name == "()": # continue indent = (len(stack) - 1) * " " self._tw.line("%s%s" % (indent, col)) diff --git a/_pytest/tmpdir.py b/_pytest/tmpdir.py index 78392e378..da1b03223 100644 --- a/_pytest/tmpdir.py +++ b/_pytest/tmpdir.py @@ -25,7 +25,7 @@ class TempdirFactory: provides an empty unique-per-test-invocation directory and is guaranteed to be empty. """ - #py.log._apiwarn(">1.1", "use tmpdir function argument") + # py.log._apiwarn(">1.1", "use tmpdir function argument") return self.getbasetemp().ensure(string, dir=dir) def mktemp(self, basename, numbered=True): diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index e1a2956a3..ea8ef747e 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -119,7 +119,7 @@ class TestGeneralUsage(object): testdir.makepyfile(import_fails="import does_not_work") result = testdir.runpytest(p) result.stdout.fnmatch_lines([ - #XXX on jython this fails: "> import import_fails", + # XXX on jython this fails: "> import import_fails", "ImportError while importing test module*", "*No module named *does_not_work*", ]) @@ -440,8 +440,8 @@ class TestInvocationVariants(object): #collect #cmdline #Item - #assert collect.Item is Item - #assert collect.Collector is Collector + # assert collect.Item is Item + # assert collect.Collector is Collector main skip xfail diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index a042e14bd..b73ef5232 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -72,9 +72,9 @@ def test_excinfo_getstatement(): l = list(excinfo.traceback) foundlinenumbers = [x.lineno for x in l] assert foundlinenumbers == linenumbers - #for x in info: + # for x in info: # print "%s:%d %s" %(x.path.relto(root), x.lineno, x.statement) - #xxx + # xxx # testchain for getentries test below def f(): @@ -238,7 +238,7 @@ class TestTraceback_f_g_h(object): assert recindex is None def test_traceback_messy_recursion(self): - #XXX: simplified locally testable version + # XXX: simplified locally testable version decorator = pytest.importorskip('decorator').decorator def log(f, *k, **kw): @@ -331,7 +331,7 @@ def test_excinfo_no_sourcecode(): assert s == " File '':1 in \n ???\n" def test_excinfo_no_python_sourcecode(tmpdir): - #XXX: simplified locally testable version + # XXX: simplified locally testable version tmpdir.join('test.txt').write("{{ h()}}:") jinja2 = pytest.importorskip('jinja2') @@ -575,7 +575,7 @@ raise ValueError() loc = repr_entry.reprfileloc assert loc.path == mod.__file__ assert loc.lineno == 3 - #assert loc.message == "ValueError: hello" + # assert loc.message == "ValueError: hello" def test_repr_tracebackentry_lines2(self, importasmod): mod = importasmod(""" diff --git a/testing/code/test_source.py b/testing/code/test_source.py index c9ce42147..a089db054 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -181,16 +181,16 @@ class TestSourceParsingAndCompiling(object): assert 'ValueError' in source2 def test_getstatement(self): - #print str(self.source) + # print str(self.source) ass = str(self.source[1:]) for i in range(1, 4): - #print "trying start in line %r" % self.source[i] + # print "trying start in line %r" % self.source[i] s = self.source.getstatement(i) #x = s.deindent() assert str(s) == ass def test_getstatementrange_triple_quoted(self): - #print str(self.source) + # print str(self.source) source = Source("""hello(''' ''')""") s = source.getstatement(0) @@ -211,12 +211,12 @@ class TestSourceParsingAndCompiling(object): """) assert len(source) == 7 # check all lineno's that could occur in a traceback - #assert source.getstatementrange(0) == (0, 7) - #assert source.getstatementrange(1) == (1, 5) + # assert source.getstatementrange(0) == (0, 7) + # assert source.getstatementrange(1) == (1, 5) assert source.getstatementrange(2) == (2, 3) assert source.getstatementrange(3) == (3, 4) assert source.getstatementrange(4) == (4, 5) - #assert source.getstatementrange(5) == (0, 7) + # assert source.getstatementrange(5) == (0, 7) assert source.getstatementrange(6) == (6, 7) def test_getstatementrange_bug(self): @@ -283,7 +283,7 @@ class TestSourceParsingAndCompiling(object): excinfo = pytest.raises(AssertionError, "f(6)") frame = excinfo.traceback[-1].frame stmt = frame.code.fullsource.getstatement(frame.lineno) - #print "block", str(block) + # print "block", str(block) assert str(stmt).strip().startswith('assert') @pytest.mark.parametrize('name', ['', None, 'my']) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index 33fa4ba96..af8e6a77a 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -2373,7 +2373,7 @@ class TestFixtureMarker(object): l = reprec.getcalls("pytest_runtest_call")[0].item.module.l import pprint pprint.pprint(l) - #assert len(l) == 6 + # assert len(l) == 6 assert l[0] == l[1] == 1 assert l[2] == "fin1" assert l[3] == l[4] == 2 diff --git a/testing/test_assertion.py b/testing/test_assertion.py index c6af5c1cc..e5eff7e03 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -822,7 +822,7 @@ def test_traceback_failure(testdir): "", "*test_*.py:6: ", "_ _ _ *", - #"", + # "", " def f(x):", "> assert x == g()", "E assert 3 == 2", diff --git a/testing/test_capture.py b/testing/test_capture.py index cb9431141..4b495ed2c 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -234,7 +234,7 @@ class TestPerTestCapturing(object): "setup func1*", "in func1*", "teardown func1*", - #"*1 fixture failure*" + # "*1 fixture failure*" ]) def test_teardown_capturing_final(self, testdir): diff --git a/testing/test_collection.py b/testing/test_collection.py index ce5e99908..49bfc2a56 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -362,9 +362,9 @@ class TestSession(object): topdir = testdir.tmpdir rcol = Session(config) assert topdir == rcol.fspath - #rootid = rcol.nodeid - #root2 = rcol.perform_collect([rcol.nodeid], genitems=False)[0] - #assert root2 == rcol, rootid + # rootid = rcol.nodeid + # root2 = rcol.perform_collect([rcol.nodeid], genitems=False)[0] + # assert root2 == rcol, rootid colitems = rcol.perform_collect([rcol.nodeid], genitems=False) assert len(colitems) == 1 assert colitems[0].fspath == p diff --git a/testing/test_conftest.py b/testing/test_conftest.py index dd696fe5b..e7034179f 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -43,7 +43,7 @@ class TestConftestValueAccessGlobal(object): len(conftest._path2confmods) conftest._getconftestmodules(basedir) snap1 = len(conftest._path2confmods) - #assert len(conftest._path2confmods) == snap1 + 1 + # assert len(conftest._path2confmods) == snap1 + 1 conftest._getconftestmodules(basedir.join('adir')) assert len(conftest._path2confmods) == snap1 + 1 conftest._getconftestmodules(basedir.join('b')) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index ec3f8ba7a..dfbab28cc 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -19,7 +19,7 @@ class TestDoctests(object): """) for x in (testdir.tmpdir, checkfile): - #print "checking that %s returns custom items" % (x,) + # print "checking that %s returns custom items" % (x,) items, reprec = testdir.inline_genitems(x) assert len(items) == 1 assert isinstance(items[0], DoctestItem) diff --git a/testing/test_helpconfig.py b/testing/test_helpconfig.py index 41fa953ad..3d216b3bc 100644 --- a/testing/test_helpconfig.py +++ b/testing/test_helpconfig.py @@ -5,7 +5,7 @@ import pytest def test_version(testdir, pytestconfig): result = testdir.runpytest("--version") assert result.ret == 0 - #p = py.path.local(py.__file__).dirpath() + # p = py.path.local(py.__file__).dirpath() result.stderr.fnmatch_lines([ '*pytest*%s*imported from*' % (pytest.__version__, ) ]) diff --git a/testing/test_pdb.py b/testing/test_pdb.py index 2445c807c..b6543b053 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -181,7 +181,7 @@ class TestPDB(object): xxx """) child = testdir.spawn_pytest("--pdb %s" % p1) - #child.expect(".*import pytest.*") + # child.expect(".*import pytest.*") child.expect("(Pdb)") child.sendeof() child.expect("1 error") @@ -194,7 +194,7 @@ class TestPDB(object): """) p1 = testdir.makepyfile("def test_func(): pass") child = testdir.spawn_pytest("--pdb %s" % p1) - #child.expect(".*import pytest.*") + # child.expect(".*import pytest.*") child.expect("(Pdb)") child.sendeof() self.flush(child) diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index 6428bf9d9..d1e1ff2de 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -31,7 +31,7 @@ class TestPytestPluginInteractions(object): pm.hook.pytest_addhooks.call_historic( kwargs=dict(pluginmanager=config.pluginmanager)) config.pluginmanager._importconftest(conf) - #print(config.pluginmanager.get_plugins()) + # print(config.pluginmanager.get_plugins()) res = config.hook.pytest_myhook(xyz=10) assert res == [11] @@ -232,7 +232,7 @@ class TestPytestPluginManager(object): assert mod in l pytest.raises(ValueError, "pm.register(mod)") pytest.raises(ValueError, lambda: pm.register(mod)) - #assert not pm.is_registered(mod2) + # assert not pm.is_registered(mod2) assert pm.get_plugins() == l def test_canonical_import(self, monkeypatch): @@ -259,7 +259,7 @@ class TestPytestPluginManager(object): mod.pytest_plugins = "pytest_a" aplugin = testdir.makepyfile(pytest_a="#") reprec = testdir.make_hook_recorder(pytestpm) - #syspath.prepend(aplugin.dirpath()) + # syspath.prepend(aplugin.dirpath()) py.std.sys.path.insert(0, str(aplugin.dirpath())) pytestpm.consider_module(mod) call = reprec.getcall(pytestpm.hook.pytest_plugin_registered.name) diff --git a/testing/test_resultlog.py b/testing/test_resultlog.py index c5416fa03..86ae5ab39 100644 --- a/testing/test_resultlog.py +++ b/testing/test_resultlog.py @@ -14,7 +14,7 @@ def test_generic_path(testdir): config = testdir.parseconfig() session = Session(config) p1 = Node('a', config=config, session=session) - #assert p1.fspath is None + # assert p1.fspath is None p2 = Node('B', parent=p1) p3 = Node('()', parent=p2) item = Item('c', parent=p3) diff --git a/testing/test_runner.py b/testing/test_runner.py index 5fb96d008..26e6816cb 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -94,7 +94,7 @@ class BaseFunctionalTests(object): assert rep.failed assert rep.when == "call" assert rep.outcome == "failed" - #assert isinstance(rep.longrepr, ReprExceptionInfo) + # assert isinstance(rep.longrepr, ReprExceptionInfo) def test_skipfunction(self, testdir): reports = testdir.runitem(""" @@ -107,12 +107,12 @@ class BaseFunctionalTests(object): assert not rep.passed assert rep.skipped assert rep.outcome == "skipped" - #assert rep.skipped.when == "call" - #assert rep.skipped.when == "call" - #assert rep.skipped == "%sreason == "hello" - #assert rep.skipped.location.lineno == 3 - #assert rep.skipped.location.path - #assert not rep.skipped.failurerepr + # assert rep.skipped.when == "call" + # assert rep.skipped.when == "call" + # assert rep.skipped == "%sreason == "hello" + # assert rep.skipped.location.lineno == 3 + # assert rep.skipped.location.path + # assert not rep.skipped.failurerepr def test_skip_in_setup_function(self, testdir): reports = testdir.runitem(""" @@ -127,9 +127,9 @@ class BaseFunctionalTests(object): assert not rep.failed assert not rep.passed assert rep.skipped - #assert rep.skipped.reason == "hello" - #assert rep.skipped.location.lineno == 3 - #assert rep.skipped.location.lineno == 3 + # assert rep.skipped.reason == "hello" + # assert rep.skipped.location.lineno == 3 + # assert rep.skipped.location.lineno == 3 assert len(reports) == 2 assert reports[1].passed # teardown @@ -163,8 +163,8 @@ class BaseFunctionalTests(object): assert not rep.passed assert rep.failed assert rep.when == "teardown" - #assert rep.longrepr.reprcrash.lineno == 3 - #assert rep.longrepr.reprtraceback.reprentries + # assert rep.longrepr.reprcrash.lineno == 3 + # assert rep.longrepr.reprtraceback.reprentries def test_custom_failure_repr(self, testdir): testdir.makepyfile(conftest=""" @@ -182,10 +182,10 @@ class BaseFunctionalTests(object): assert not rep.skipped assert not rep.passed assert rep.failed - #assert rep.outcome.when == "call" - #assert rep.failed.where.lineno == 3 - #assert rep.failed.where.path.basename == "test_func.py" - #assert rep.failed.failurerepr == "hello" + # assert rep.outcome.when == "call" + # assert rep.failed.where.lineno == 3 + # assert rep.failed.where.path.basename == "test_func.py" + # assert rep.failed.failurerepr == "hello" def test_teardown_final_returncode(self, testdir): rec = testdir.inline_runsource(""" @@ -287,10 +287,10 @@ class BaseFunctionalTests(object): assert not rep.skipped assert not rep.passed assert rep.failed - #assert rep.outcome.when == "setup" - #assert rep.outcome.where.lineno == 3 - #assert rep.outcome.where.path.basename == "test_func.py" - #assert instanace(rep.failed.failurerepr, PythonFailureRepr) + # assert rep.outcome.when == "setup" + # assert rep.outcome.where.lineno == 3 + # assert rep.outcome.where.path.basename == "test_func.py" + # assert instanace(rep.failed.failurerepr, PythonFailureRepr) def test_systemexit_does_not_bail_out(self, testdir): try: @@ -540,8 +540,8 @@ def test_importorskip(monkeypatch): try: sys = importorskip("sys") # noqa assert sys == py.std.sys - #path = pytest.importorskip("os.path") - #assert path == py.std.os.path + # path = pytest.importorskip("os.path") + # assert path == py.std.os.path excinfo = pytest.raises(pytest.skip.Exception, f) path = py.path.local(excinfo.getrepr().reprcrash.path) # check that importorskip reports the actual call diff --git a/testing/test_session.py b/testing/test_session.py index 1cb0bb285..53f23df3c 100644 --- a/testing/test_session.py +++ b/testing/test_session.py @@ -27,9 +27,9 @@ class SessionTests(object): itemstarted = reprec.getcalls("pytest_itemcollected") assert len(itemstarted) == 4 # XXX check for failing funcarg setup - #colreports = reprec.getcalls("pytest_collectreport") - #assert len(colreports) == 4 - #assert colreports[1].report.failed + # colreports = reprec.getcalls("pytest_collectreport") + # assert len(colreports) == 4 + # assert colreports[1].report.failed def test_nested_import_error(self, testdir): tfile = testdir.makepyfile(""" @@ -211,9 +211,9 @@ def test_plugin_specify(testdir): pytest.raises(ImportError, """ testdir.parseconfig("-p", "nqweotexistent") """) - #pytest.raises(ImportError, + # pytest.raises(ImportError, # "config.do_configure(config)" - #) + # ) def test_plugin_already_exists(testdir): config = testdir.parseconfig("-p", "terminal") diff --git a/testing/test_skipping.py b/testing/test_skipping.py index cfd1af684..3c92105d6 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -207,9 +207,9 @@ class TestXFail(object): assert 0 """) testdir.runpytest(p, '-v') - #result.stdout.fnmatch_lines([ + # result.stdout.fnmatch_lines([ # "*HINT*use*-r*" - #]) + # ]) def test_xfail_not_run_xfail_reporting(self, testdir): p = testdir.makepyfile(test_one=""" @@ -640,7 +640,7 @@ def test_skip_not_report_default(testdir): """) result = testdir.runpytest(p, '-v') result.stdout.fnmatch_lines([ - #"*HINT*use*-r*", + # "*HINT*use*-r*", "*1 skipped*", ]) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 5f554f7f6..f9344ca30 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -264,13 +264,13 @@ class TestCollectonly(object): pass """) result = testdir.runpytest("--collect-only", p) - #assert stderr.startswith("inserting into sys.path") + # assert stderr.startswith("inserting into sys.path") assert result.ret == 0 result.stdout.fnmatch_lines([ "*", "* ", "* ", - #"* ", + # "* ", "* ", ]) @@ -485,7 +485,7 @@ class TestTerminalFunctional(object): """) result = testdir.runpytest(p1, '-l') result.stdout.fnmatch_lines([ - #"_ _ * Locals *", + # "_ _ * Locals *", "x* = 3", "y* = 'xxxxxx*" ]) diff --git a/tox.ini b/tox.ini index 558a678a4..aa525b1fd 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731 +ignore = E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731 max-line-length = 120 exclude = _pytest/vendored_packages/pluggy.py