From 85141a419f7c8ca314ff682ad58b18f1485da993 Mon Sep 17 00:00:00 2001 From: Andras Tim Date: Mon, 17 Jul 2017 01:25:10 +0200 Subject: [PATCH] Fixed E701 flake8 errors multiple statements on one line (colon) --- testing/code/test_code.py | 16 ++++++++++------ testing/code/test_excinfo.py | 6 ++++-- testing/python/metafunc.py | 6 ++++-- testing/test_recwarn.py | 6 ++++-- tox.ini | 2 +- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/testing/code/test_code.py b/testing/code/test_code.py index acf1ffc91..6db5c6fbd 100644 --- a/testing/code/test_code.py +++ b/testing/code/test_code.py @@ -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] diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index a1b308760..a7dfe80a6 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -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:" diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 4a29cdc87..bda36f1e2 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -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}) diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index e8b1db399..5611d1a44 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -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) diff --git a/tox.ini b/tox.ini index c67225bfa..5a11cfaa6 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = E701,E702,E704,E712,E731 +ignore = E702,E704,E712,E731 max-line-length = 120 exclude = _pytest/vendored_packages/pluggy.py