From df54bf0db524a9c8e5b6c2847c56d1589f533087 Mon Sep 17 00:00:00 2001 From: Andras Tim Date: Mon, 17 Jul 2017 01:25:07 +0200 Subject: [PATCH] Fixed E131 flake8 errors continuation line unaligned for hanging indent --- _pytest/config.py | 6 +-- _pytest/python.py | 2 +- _pytest/recwarn.py | 2 +- testing/code/test_excinfo.py | 6 +-- testing/python/approx.py | 80 ++++++++++++++++++------------------ testing/test_assertion.py | 10 ++--- testing/test_mark.py | 18 ++++---- testing/test_skipping.py | 2 +- testing/test_terminal.py | 2 +- tox.ini | 2 +- 10 files changed, 65 insertions(+), 65 deletions(-) diff --git a/_pytest/config.py b/_pytest/config.py index 2c0da5640..2e42074a7 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -103,9 +103,9 @@ _preinit = [] default_plugins = ( "mark main terminal runner python fixtures debugging unittest capture skipping " - "tmpdir monkeypatch recwarn pastebin helpconfig nose assertion " - "junitxml resultlog doctest cacheprovider freeze_support " - "setuponly setupplan warnings").split() + "tmpdir monkeypatch recwarn pastebin helpconfig nose assertion " + "junitxml resultlog doctest cacheprovider freeze_support " + "setuponly setupplan warnings").split() builtin_plugins = set(default_plugins) diff --git a/_pytest/python.py b/_pytest/python.py index 9af0a27f0..8dec157c5 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -419,7 +419,7 @@ class Module(main.File, PyCollector): " %s\n" "HINT: remove __pycache__ / .pyc files and/or use a " "unique basename for your test file modules" - % e.args + % e.args ) except ImportError: from _pytest._code.code import ExceptionInfo diff --git a/_pytest/recwarn.py b/_pytest/recwarn.py index cc7874550..b9938752c 100644 --- a/_pytest/recwarn.py +++ b/_pytest/recwarn.py @@ -201,4 +201,4 @@ class WarningsChecker(WarningsRecorder): fail("DID NOT WARN. No warnings of type {0} was emitted. " "The list of emitted warnings is: {1}.".format( self.expected_warning, - [each.message for each in self])) + [each.message for each in self])) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 7623da319..2783f7685 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -935,9 +935,9 @@ raise ValueError() {'style': style, 'showlocals': showlocals, 'funcargs': funcargs, 'tbfilter': tbfilter } for style in ("long", "short", "no") - for showlocals in (True, False) - for tbfilter in (True, False) - for funcargs in (True, False)]) + for showlocals in (True, False) + for tbfilter in (True, False) + for funcargs in (True, False)]) def test_format_excinfo(self, importasmod, reproptions): mod = importasmod(""" def g(x): diff --git a/testing/python/approx.py b/testing/python/approx.py index 6338441ae..97669b076 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -44,13 +44,13 @@ class TestApprox(object): def test_exactly_equal(self): examples = [ (2.0, 2.0), - (0.1e200, 0.1e200), - (1.123e-300, 1.123e-300), - (12345, 12345.0), - (0.0, -0.0), - (345678, 345678), - (Decimal('1.0001'), Decimal('1.0001')), - (Fraction(1, 3), Fraction(-1, -3)), + (0.1e200, 0.1e200), + (1.123e-300, 1.123e-300), + (12345, 12345.0), + (0.0, -0.0), + (345678, 345678), + (Decimal('1.0001'), Decimal('1.0001')), + (Fraction(1, 3), Fraction(-1, -3)), ] for a, x in examples: assert a == approx(x) @@ -58,7 +58,7 @@ class TestApprox(object): def test_opposite_sign(self): examples = [ (eq, 1e-100, -1e-100), - (ne, 1e100, -1e100), + (ne, 1e100, -1e100), ] for op, a, x in examples: assert op(a, approx(x)) @@ -66,7 +66,7 @@ class TestApprox(object): def test_zero_tolerance(self): within_1e10 = [ (1.1e-100, 1e-100), - (-1.1e-100, -1e-100), + (-1.1e-100, -1e-100), ] for a, x in within_1e10: assert x == approx(x, rel=0.0, abs=0.0) @@ -93,9 +93,9 @@ class TestApprox(object): # Everything should be equal if the tolerance is infinite. large_diffs = [ (1, 1000), - (1e-50, 1e50), - (-1.0, -1e300), - (0.0, 10), + (1e-50, 1e50), + (-1.0, -1e300), + (0.0, 10), ] for a, x in large_diffs: assert a != approx(x, rel=0.0, abs=0.0) @@ -136,14 +136,14 @@ class TestApprox(object): # the choice of defaults. examples = [ # Relative tolerance used. - (eq, 1e100 + 1e94, 1e100), - (ne, 1e100 + 2e94, 1e100), - (eq, 1e0 + 1e-6, 1e0), - (ne, 1e0 + 2e-6, 1e0), - # Absolute tolerance used. - (eq, 1e-100, + 1e-106), - (eq, 1e-100, + 2e-106), - (eq, 1e-100, 0), + (eq, 1e100 + 1e94, 1e100), + (ne, 1e100 + 2e94, 1e100), + (eq, 1e0 + 1e-6, 1e0), + (ne, 1e0 + 2e-6, 1e0), + # Absolute tolerance used. + (eq, 1e-100, + 1e-106), + (eq, 1e-100, + 2e-106), + (eq, 1e-100, 0), ] for op, a, x in examples: assert op(a, approx(x)) @@ -167,8 +167,8 @@ class TestApprox(object): def test_relative_tolerance(self): within_1e8_rel = [ (1e8 + 1e0, 1e8), - (1e0 + 1e-8, 1e0), - (1e-8 + 1e-16, 1e-8), + (1e0 + 1e-8, 1e0), + (1e-8 + 1e-16, 1e-8), ] for a, x in within_1e8_rel: assert a == approx(x, rel=5e-8, abs=0.0) @@ -177,8 +177,8 @@ class TestApprox(object): def test_absolute_tolerance(self): within_1e8_abs = [ (1e8 + 9e-9, 1e8), - (1e0 + 9e-9, 1e0), - (1e-8 + 9e-9, 1e-8), + (1e0 + 9e-9, 1e0), + (1e-8 + 9e-9, 1e-8), ] for a, x in within_1e8_abs: assert a == approx(x, rel=0, abs=5e-8) @@ -202,10 +202,10 @@ class TestApprox(object): def test_expecting_inf(self): examples = [ (eq, inf, inf), - (eq, -inf, -inf), - (ne, inf, -inf), - (ne, 0.0, inf), - (ne, nan, inf), + (eq, -inf, -inf), + (ne, inf, -inf), + (ne, 0.0, inf), + (ne, nan, inf), ] for op, a, x in examples: assert op(a, approx(x)) @@ -213,10 +213,10 @@ class TestApprox(object): def test_expecting_nan(self): examples = [ (nan, nan), - (-nan, -nan), - (nan, -nan), - (0.0, nan), - (inf, nan), + (-nan, -nan), + (nan, -nan), + (0.0, nan), + (inf, nan), ] for a, x in examples: # If there is a relative tolerance and the expected value is NaN, @@ -231,8 +231,8 @@ class TestApprox(object): def test_expecting_sequence(self): within_1e8 = [ (1e8 + 1e0, 1e8), - (1e0 + 1e-8, 1e0), - (1e-8 + 1e-16, 1e-8), + (1e0 + 1e-8, 1e0), + (1e-8 + 1e-16, 1e-8), ] actual, expected = zip(*within_1e8) assert actual == approx(expected, rel=5e-8, abs=0.0) @@ -244,9 +244,9 @@ class TestApprox(object): def test_complex(self): within_1e6 = [ ( 1.000001 + 1.0j, 1.0 + 1.0j), - (1.0 + 1.000001j, 1.0 + 1.0j), - (-1.000001 + 1.0j, -1.0 + 1.0j), - (1.0 - 1.000001j, 1.0 - 1.0j), + (1.0 + 1.000001j, 1.0 + 1.0j), + (-1.000001 + 1.0j, -1.0 + 1.0j), + (1.0 - 1.000001j, 1.0 - 1.0j), ] for a, x in within_1e6: assert a == approx(x, rel=5e-6, abs=0) @@ -255,7 +255,7 @@ class TestApprox(object): def test_int(self): within_1e6 = [ (1000001, 1000000), - (-1000001, -1000000), + (-1000001, -1000000), ] for a, x in within_1e6: assert a == approx(x, rel=5e-6, abs=0) @@ -264,7 +264,7 @@ class TestApprox(object): def test_decimal(self): within_1e6 = [ (Decimal('1.000001'), Decimal('1.0')), - (Decimal('-1.000001'), Decimal('-1.0')), + (Decimal('-1.000001'), Decimal('-1.0')), ] for a, x in within_1e6: assert a == approx(x, rel=Decimal('5e-6'), abs=0) @@ -273,7 +273,7 @@ class TestApprox(object): def test_fraction(self): within_1e6 = [ (1 + Fraction(1, 1000000), Fraction(1)), - (-1 - Fraction(-1, 1000000), Fraction(-1)), + (-1 - Fraction(-1, 1000000), Fraction(-1)), ] for a, x in within_1e6: assert a == approx(x, rel=5e-6, abs=0) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index cf31f3d92..3f6ae394c 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -773,11 +773,11 @@ def test_assertrepr_loaded_per_dir(testdir): result = testdir.runpytest() result.stdout.fnmatch_lines([ '*def test_base():*', - '*E*assert 1 == 2*', - '*def test_a():*', - '*E*assert summary a*', - '*def test_b():*', - '*E*assert summary b*']) + '*E*assert 1 == 2*', + '*def test_a():*', + '*E*assert summary a*', + '*def test_b():*', + '*E*assert summary b*']) def test_assertion_options(testdir): diff --git a/testing/test_mark.py b/testing/test_mark.py index 25ca7f0f1..309e2379c 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -201,9 +201,9 @@ def test_strict_prohibits_unregistered_markers(testdir): @pytest.mark.parametrize("spec", [ ("xyz", ("test_one",)), - ("xyz and xyz2", ()), - ("xyz2", ("test_two",)), - ("xyz or xyz2", ("test_one", "test_two"),) + ("xyz and xyz2", ()), + ("xyz2", ("test_two",)), + ("xyz or xyz2", ("test_one", "test_two"),) ]) def test_mark_option(spec, testdir): testdir.makepyfile(""" @@ -224,7 +224,7 @@ def test_mark_option(spec, testdir): @pytest.mark.parametrize("spec", [ ("interface", ("test_interface",)), - ("not interface", ("test_nointer",)), + ("not interface", ("test_nointer",)), ]) def test_mark_option_custom(spec, testdir): testdir.makeconftest(""" @@ -249,9 +249,9 @@ def test_mark_option_custom(spec, testdir): @pytest.mark.parametrize("spec", [ ("interface", ("test_interface",)), - ("not interface", ("test_nointer", "test_pass")), - ("pass", ("test_pass",)), - ("not pass", ("test_interface", "test_nointer")), + ("not interface", ("test_nointer", "test_pass")), + ("pass", ("test_pass",)), + ("not pass", ("test_interface", "test_nointer")), ]) def test_keyword_option_custom(spec, testdir): testdir.makepyfile(""" @@ -272,8 +272,8 @@ def test_keyword_option_custom(spec, testdir): @pytest.mark.parametrize("spec", [ ("None", ("test_func[None]",)), - ("1.3", ("test_func[1.3]",)), - ("2-3", ("test_func[2-3]",)) + ("1.3", ("test_func[1.3]",)), + ("2-3", ("test_func[2-3]",)) ]) def test_keyword_option_parametrize(spec, testdir): testdir.makepyfile(""" diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 5a6692b3c..94423da3b 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -699,7 +699,7 @@ def test_skipped_reasons_functional(testdir): def test_method(self): doskip() """, - conftest = """ + conftest = """ import pytest def doskip(): pytest.skip('test') diff --git a/testing/test_terminal.py b/testing/test_terminal.py index dd5311776..048cdc821 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -223,7 +223,7 @@ class TestCollectonly(object): result = testdir.runpytest("--collect-only",) result.stdout.fnmatch_lines([ "", - " ", + " ", ]) def test_collectonly_skipped_module(self, testdir): diff --git a/tox.ini b/tox.ini index 2ea365605..66c52f3b1 100644 --- a/tox.ini +++ b/tox.ini @@ -196,6 +196,6 @@ filterwarnings = ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning [flake8] -ignore = E131,E201,E202,E203,E221,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731 +ignore = E201,E202,E203,E221,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731 max-line-length = 120 exclude = _pytest/vendored_packages/pluggy.py