Fixed E128 flake8 errors
continuation line under-indented for visual indent
This commit is contained in:
@@ -298,7 +298,7 @@ def test_excinfo_exconly():
|
||||
excinfo = pytest.raises(ValueError, h)
|
||||
assert excinfo.exconly().startswith('ValueError')
|
||||
excinfo = pytest.raises(ValueError,
|
||||
"raise ValueError('hello\\nworld')")
|
||||
"raise ValueError('hello\\nworld')")
|
||||
msg = excinfo.exconly(tryshort=True)
|
||||
assert msg.startswith('ValueError')
|
||||
assert msg.endswith("world")
|
||||
|
||||
@@ -419,10 +419,10 @@ class TestFunction(object):
|
||||
pass
|
||||
|
||||
f1 = pytest.Function(name="name", parent=session, config=config,
|
||||
args=(1,), callobj=func1)
|
||||
args=(1,), callobj=func1)
|
||||
assert f1 == f1
|
||||
f2 = pytest.Function(name="name",config=config,
|
||||
callobj=func2, parent=session)
|
||||
callobj=func2, parent=session)
|
||||
assert f1 != f2
|
||||
|
||||
def test_issue197_parametrize_emptyset(self, testdir):
|
||||
@@ -838,7 +838,7 @@ class TestConftestCustomization(object):
|
||||
modcol = testdir.getmodulecol("def _hello(): pass")
|
||||
l = []
|
||||
monkeypatch.setattr(pytest.Module, 'makeitem',
|
||||
lambda self, name, obj: l.append(name))
|
||||
lambda self, name, obj: l.append(name))
|
||||
l = modcol.collect()
|
||||
assert '_hello' not in l
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@ class TestMetafunc(object):
|
||||
metafunc = self.Metafunc(func)
|
||||
|
||||
pytest.raises(ValueError, lambda:
|
||||
metafunc.parametrize("x", [1,2], ids=['basic']))
|
||||
metafunc.parametrize("x", [1,2], ids=['basic']))
|
||||
|
||||
pytest.raises(ValueError, lambda:
|
||||
metafunc.parametrize(("x","y"), [("abc", "def"),
|
||||
("ghi", "jkl")], ids=["one"]))
|
||||
metafunc.parametrize(("x","y"), [("abc", "def"),
|
||||
("ghi", "jkl")], ids=["one"]))
|
||||
|
||||
@pytest.mark.issue510
|
||||
def test_parametrize_empty_list(self):
|
||||
@@ -1114,7 +1114,7 @@ class TestMetafuncFunctional(object):
|
||||
|
||||
@pytest.mark.issue463
|
||||
@pytest.mark.parametrize('attr', ['parametrise', 'parameterize',
|
||||
'parameterise'])
|
||||
'parameterise'])
|
||||
def test_parametrize_misspelling(self, testdir, attr):
|
||||
testdir.makepyfile("""
|
||||
import pytest
|
||||
|
||||
@@ -51,17 +51,17 @@ class FilesCompleter(object):
|
||||
if self.allowednames:
|
||||
if self.directories:
|
||||
files = _wrapcall(['bash','-c',
|
||||
"compgen -A directory -- '{p}'".format(p=prefix)])
|
||||
"compgen -A directory -- '{p}'".format(p=prefix)])
|
||||
completion += [ f + '/' for f in files]
|
||||
for x in self.allowednames:
|
||||
completion += _wrapcall(['bash', '-c',
|
||||
"compgen -A file -X '!*.{0}' -- '{p}'".format(x,p=prefix)])
|
||||
"compgen -A file -X '!*.{0}' -- '{p}'".format(x,p=prefix)])
|
||||
else:
|
||||
completion += _wrapcall(['bash', '-c',
|
||||
"compgen -A file -- '{p}'".format(p=prefix)])
|
||||
"compgen -A file -- '{p}'".format(p=prefix)])
|
||||
|
||||
anticomp = _wrapcall(['bash', '-c',
|
||||
"compgen -A directory -- '{p}'".format(p=prefix)])
|
||||
"compgen -A directory -- '{p}'".format(p=prefix)])
|
||||
|
||||
completion = list( set(completion) - set(anticomp))
|
||||
|
||||
|
||||
@@ -639,7 +639,7 @@ def test_rewritten():
|
||||
assert testdir.runpytest().ret == 0
|
||||
|
||||
@pytest.mark.skipif(sys.version_info < (3,3),
|
||||
reason='packages without __init__.py not supported on python 2')
|
||||
reason='packages without __init__.py not supported on python 2')
|
||||
def test_package_without__init__py(self, testdir):
|
||||
pkg = testdir.mkdir('a_package_without_init_py')
|
||||
pkg.join('module.py').ensure()
|
||||
|
||||
@@ -72,7 +72,7 @@ class TestCaptureManager(object):
|
||||
|
||||
@needsosdup
|
||||
@pytest.mark.parametrize("method",
|
||||
['no', 'sys', pytest.mark.skipif('not hasattr(os, "dup")', 'fd')])
|
||||
['no', 'sys', pytest.mark.skipif('not hasattr(os, "dup")', 'fd')])
|
||||
def test_capturing_basic_api(self, method):
|
||||
capouter = StdCaptureFD()
|
||||
old = sys.stdout, sys.stderr, sys.stdin
|
||||
|
||||
@@ -149,7 +149,7 @@ class TestConfigAPI(object):
|
||||
def test_config_getvalueorskip(self, testdir):
|
||||
config = testdir.parseconfig()
|
||||
pytest.raises(pytest.skip.Exception,
|
||||
"config.getvalueorskip('hello')")
|
||||
"config.getvalueorskip('hello')")
|
||||
verbose = config.getvalueorskip("verbose")
|
||||
assert verbose == config.option.verbose
|
||||
|
||||
|
||||
@@ -32,14 +32,14 @@ class TestDoctests(object):
|
||||
path = testdir.makepyfile(whatever="#")
|
||||
for p in (path, testdir.tmpdir):
|
||||
items, reprec = testdir.inline_genitems(p,
|
||||
'--doctest-modules')
|
||||
'--doctest-modules')
|
||||
assert len(items) == 0
|
||||
|
||||
def test_collect_module_single_modulelevel_doctest(self, testdir):
|
||||
path = testdir.makepyfile(whatever='""">>> pass"""')
|
||||
for p in (path, testdir.tmpdir):
|
||||
items, reprec = testdir.inline_genitems(p,
|
||||
'--doctest-modules')
|
||||
'--doctest-modules')
|
||||
assert len(items) == 1
|
||||
assert isinstance(items[0], DoctestItem)
|
||||
assert isinstance(items[0].parent, DoctestModule)
|
||||
@@ -52,7 +52,7 @@ class TestDoctests(object):
|
||||
""")
|
||||
for p in (path, testdir.tmpdir):
|
||||
items, reprec = testdir.inline_genitems(p,
|
||||
'--doctest-modules')
|
||||
'--doctest-modules')
|
||||
assert len(items) == 2
|
||||
assert isinstance(items[0], DoctestItem)
|
||||
assert isinstance(items[1], DoctestItem)
|
||||
@@ -77,7 +77,7 @@ class TestDoctests(object):
|
||||
""")
|
||||
for p in (path, testdir.tmpdir):
|
||||
items, reprec = testdir.inline_genitems(p,
|
||||
'--doctest-modules')
|
||||
'--doctest-modules')
|
||||
assert len(items) == 2
|
||||
assert isinstance(items[0], DoctestItem)
|
||||
assert isinstance(items[1], DoctestItem)
|
||||
|
||||
@@ -249,7 +249,7 @@ class TestParser(object):
|
||||
group = parser.getgroup("general")
|
||||
group.addoption('--doit', '--func-args', action='store_true', help='foo')
|
||||
group._addoption("-h", "--help", action="store_true", dest="help",
|
||||
help="show help message and configuration info")
|
||||
help="show help message and configuration info")
|
||||
parser.parse(['-h'])
|
||||
help = parser.optparser.format_help()
|
||||
assert '-doit, --func-args foo' in help
|
||||
|
||||
@@ -352,7 +352,7 @@ class TestPytestPluginManager(object):
|
||||
class TestPytestPluginManagerBootstrapming(object):
|
||||
def test_preparse_args(self, pytestpm):
|
||||
pytest.raises(ImportError, lambda:
|
||||
pytestpm.consider_preparse(["xyz", "-p", "hello123"]))
|
||||
pytestpm.consider_preparse(["xyz", "-p", "hello123"]))
|
||||
|
||||
def test_plugin_prevent_register(self, pytestpm):
|
||||
pytestpm.consider_preparse(["xyz", "-p", "no:abc"])
|
||||
|
||||
@@ -110,7 +110,7 @@ class TestTerminal(object):
|
||||
item.config.pluginmanager.register(tr)
|
||||
location = item.reportinfo()
|
||||
tr.config.hook.pytest_runtest_logstart(nodeid=item.nodeid,
|
||||
location=location, fspath=str(item.fspath))
|
||||
location=location, fspath=str(item.fspath))
|
||||
linecomp.assert_contains_lines([
|
||||
"*test_show_runtest_logstart.py*"
|
||||
])
|
||||
@@ -905,9 +905,9 @@ def test_terminal_summary_warnings_are_displayed(testdir):
|
||||
|
||||
("green", "1 passed, 2 skipped, 3 deselected, 2 xfailed",
|
||||
{"passed": (1,),
|
||||
"skipped": (1,2),
|
||||
"deselected": (1,2,3),
|
||||
"xfailed": (1,2)}),
|
||||
"skipped": (1,2),
|
||||
"deselected": (1,2,3),
|
||||
"xfailed": (1,2)}),
|
||||
])
|
||||
def test_summary_stats(exp_line, exp_color, stats_arg):
|
||||
print("Based on stats: %s" % stats_arg)
|
||||
|
||||
Reference in New Issue
Block a user