Fixed E701 flake8 errors
multiple statements on one line (colon)
This commit is contained in:
parent
7d2ceb7872
commit
85141a419f
|
@ -149,8 +149,10 @@ class TestExceptionInfo(object):
|
|||
|
||||
def test_bad_getsource(self):
|
||||
try:
|
||||
if False: pass
|
||||
else: assert False
|
||||
if False:
|
||||
pass
|
||||
else:
|
||||
assert False
|
||||
except AssertionError:
|
||||
exci = _pytest._code.ExceptionInfo()
|
||||
assert exci.getrepr()
|
||||
|
@ -160,11 +162,13 @@ class TestTracebackEntry(object):
|
|||
|
||||
def test_getsource(self):
|
||||
try:
|
||||
if False: pass
|
||||
else: assert False
|
||||
if False:
|
||||
pass
|
||||
else:
|
||||
assert False
|
||||
except AssertionError:
|
||||
exci = _pytest._code.ExceptionInfo()
|
||||
entry = exci.traceback[0]
|
||||
source = entry.getsource()
|
||||
assert len(source) == 4
|
||||
assert 'else: assert False' in source[3]
|
||||
assert len(source) == 6
|
||||
assert 'assert False' in source[5]
|
||||
|
|
|
@ -991,7 +991,8 @@ raise ValueError()
|
|||
r = excinfo.getrepr(style="long")
|
||||
tw = TWMock()
|
||||
r.toterminal(tw)
|
||||
for line in tw.lines: print (line)
|
||||
for line in tw.lines:
|
||||
print (line)
|
||||
assert tw.lines[0] == ""
|
||||
assert tw.lines[1] == " def f():"
|
||||
assert tw.lines[2] == "> g()"
|
||||
|
@ -1038,7 +1039,8 @@ raise ValueError()
|
|||
r = excinfo.getrepr(style="long")
|
||||
tw = TWMock()
|
||||
r.toterminal(tw)
|
||||
for line in tw.lines: print (line)
|
||||
for line in tw.lines:
|
||||
print (line)
|
||||
assert tw.lines[0] == ""
|
||||
assert tw.lines[1] == " def f():"
|
||||
assert tw.lines[2] == " try:"
|
||||
|
|
|
@ -68,7 +68,8 @@ class TestMetafunc(object):
|
|||
def func(arg1): pass
|
||||
metafunc = self.Metafunc(func)
|
||||
|
||||
class obj(object): pass
|
||||
class obj(object):
|
||||
pass
|
||||
|
||||
metafunc.addcall(param=obj)
|
||||
metafunc.addcall(param=obj)
|
||||
|
@ -83,7 +84,8 @@ class TestMetafunc(object):
|
|||
|
||||
metafunc = self.Metafunc(func)
|
||||
|
||||
class obj(object): pass
|
||||
class obj(object):
|
||||
pass
|
||||
|
||||
metafunc.addcall(funcargs={"x": 2})
|
||||
metafunc.addcall(funcargs={"x": 3})
|
||||
|
|
|
@ -283,9 +283,11 @@ class TestWarns(object):
|
|||
assert str(record[0].message) == "user"
|
||||
assert str(record[1].message) == "runtime"
|
||||
|
||||
class MyUserWarning(UserWarning): pass
|
||||
class MyUserWarning(UserWarning):
|
||||
pass
|
||||
|
||||
class MyRuntimeWarning(RuntimeWarning): pass
|
||||
class MyRuntimeWarning(RuntimeWarning):
|
||||
pass
|
||||
|
||||
with pytest.warns((UserWarning, RuntimeWarning)) as record:
|
||||
warnings.warn("user", MyUserWarning)
|
||||
|
|
Loading…
Reference in New Issue