From f9aaec770e738b109dc1e9251f4bfe9081e3206f Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Wed, 27 Jan 2021 19:52:03 -0700 Subject: [PATCH] mgr/cephadm: Expected 2 blank lines, found 0 (E302) Signed-off-by: Michael Fritch (cherry picked from commit 7e73af4b9880f971129b213a55d083bea2d9c342) --- src/pybind/mgr/cephadm/tests/test_scheduling.py | 8 ++++++++ src/pybind/mgr/cephadm/tests/test_spec.py | 1 + src/pybind/mgr/tox.ini | 1 - 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/tests/test_scheduling.py b/src/pybind/mgr/cephadm/tests/test_scheduling.py index 28b219ba9c5cc..e07819c37e909 100644 --- a/src/pybind/mgr/cephadm/tests/test_scheduling.py +++ b/src/pybind/mgr/cephadm/tests/test_scheduling.py @@ -182,6 +182,7 @@ test_explicit_scheduler_results = [ (k("123 123 * *"), exactly('1', '2', '3')), ] + @pytest.mark.parametrize("spec_section_key,spec_section", [ # noqa: E128 ('h', 'hosts'), @@ -325,6 +326,7 @@ class NodeAssignmentTest(NamedTuple): daemons: List[DaemonDescription] expected: List[str] + @pytest.mark.parametrize("service_type,placement,hosts,daemons,expected", [ # noqa: E128 # just hosts @@ -448,6 +450,7 @@ class NodeAssignmentTest2(NamedTuple): expected_len: int in_set: List[str] + @pytest.mark.parametrize("service_type,placement,hosts,daemons,expected_len,in_set", [ # noqa: E128 # just count @@ -519,6 +522,7 @@ def test_node_assignment2(service_type, placement, hosts, for h in [h.hostname for h in hosts]: assert h in in_set + @pytest.mark.parametrize("service_type,placement,hosts,daemons,expected_len,must_have", [ # noqa: E128 # hosts + (smaller) count, (more) existing @@ -572,6 +576,8 @@ class NodeAssignmentTestBadSpec(NamedTuple): hosts: List[str] daemons: List[DaemonDescription] expected: str + + @pytest.mark.parametrize("service_type,placement,hosts,daemons,expected", [ # noqa: E128 # unknown host @@ -607,6 +613,7 @@ def test_bad_specs(service_type, placement, hosts, daemons, expected): get_daemons_func=lambda _: daemons).place() assert str(e.value) == expected + class ActiveAssignmentTest(NamedTuple): service_type: str placement: PlacementSpec @@ -756,6 +763,7 @@ def test_active_assignment(service_type, placement, hosts, daemons, expected): get_daemons_func=lambda _: daemons).place() assert sorted([h.hostname for h in hosts]) in expected + class OddMonsTest(NamedTuple): service_type: str placement: PlacementSpec diff --git a/src/pybind/mgr/cephadm/tests/test_spec.py b/src/pybind/mgr/cephadm/tests/test_spec.py index 2374d951e5e21..0537778994cfa 100644 --- a/src/pybind/mgr/cephadm/tests/test_spec.py +++ b/src/pybind/mgr/cephadm/tests/test_spec.py @@ -661,6 +661,7 @@ def test_custom_container_spec_config_json(): for key in ['entrypoint', 'uid', 'gid', 'bind_mounts', 'dirs']: assert key not in config_json + def test_HA_RGW_spec(): yaml_str = """service_type: ha-rgw service_id: haproxy_for_rgw diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini index 8795a2003fd0e..41d14b54c73f0 100644 --- a/src/pybind/mgr/tox.ini +++ b/src/pybind/mgr/tox.ini @@ -11,7 +11,6 @@ requires = cython [flake8] max-line-length = 100 ignore = - E302, E306, E501, E703, -- 2.39.5