Fixed E265 flake8 errors
block comment should start with ‘# ‘
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 '<string>':1 in <module>\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("""
|
||||
|
||||
@@ -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'])
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -822,7 +822,7 @@ def test_traceback_failure(testdir):
|
||||
"",
|
||||
"*test_*.py:6: ",
|
||||
"_ _ _ *",
|
||||
#"",
|
||||
# "",
|
||||
" def f(x):",
|
||||
"> assert x == g()",
|
||||
"E assert 3 == 2",
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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__, )
|
||||
])
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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*",
|
||||
])
|
||||
|
||||
|
||||
@@ -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([
|
||||
"*<Module '*.py'>",
|
||||
"* <Function 'test_func1'*>",
|
||||
"* <Class 'TestClass'>",
|
||||
#"* <Instance '()'>",
|
||||
# "* <Instance '()'>",
|
||||
"* <Function 'test_method'*>",
|
||||
])
|
||||
|
||||
@@ -485,7 +485,7 @@ class TestTerminalFunctional(object):
|
||||
""")
|
||||
result = testdir.runpytest(p1, '-l')
|
||||
result.stdout.fnmatch_lines([
|
||||
#"_ _ * Locals *",
|
||||
# "_ _ * Locals *",
|
||||
"x* = 3",
|
||||
"y* = 'xxxxxx*"
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user