From 4b10bef4710924ba7bc96e5f79b122d8d372aae8 Mon Sep 17 00:00:00 2001 From: zhulingjie Date: Sat, 5 Jan 2019 01:08:34 +0800 Subject: [PATCH] Update hacking version Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: I3a44612452f6253287641625b148ae7223eaaf1d --- .../tests/scenario/congress_datasources/test_glancev2.py | 4 ++-- .../tests/scenario/congress_datasources/test_murano.py | 4 ++-- .../tests/scenario/congress_datasources/test_neutronv2.py | 4 ++-- .../scenario/congress_datasources/test_neutronv2_qos.py | 4 ++-- .../tests/scenario/congress_datasources/test_nova.py | 4 ++-- congress_tempest_plugin/tests/scenario/manager.py | 4 ++-- .../tests/scenario/test_congress_basic_ops.py | 8 ++++---- test-requirements.txt | 2 +- tox.ini | 3 ++- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_glancev2.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_glancev2.py index ddc0103..e217127 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_glancev2.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_glancev2.py @@ -30,8 +30,8 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase): @classmethod def skip_checks(cls): super(TestGlanceV2Driver, cls).skip_checks() - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_murano.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_murano.py index 6a559dc..ca748a5 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_murano.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_murano.py @@ -36,8 +36,8 @@ class TestMuranoDriver(manager_congress.ScenarioPolicyBase): cls.__class__.__name__) raise cls.skipException(msg) - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2.py index 712953e..09102b9 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2.py @@ -34,8 +34,8 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase): @classmethod def skip_checks(cls): super(TestNeutronV2Driver, cls).skip_checks() - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2_qos.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2_qos.py index 814b8fc..83732c3 100755 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2_qos.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_neutronv2_qos.py @@ -37,8 +37,8 @@ class TestNeutronV2QosDriver(manager_congress.ScenarioPolicyBase): def skip_checks(cls): super(TestNeutronV2QosDriver, cls).skip_checks() # TODO(qos): check whether QoS extension is enabled - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py index fd89098..6c3395d 100644 --- a/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_nova.py @@ -34,8 +34,8 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase): skip_msg = ("%s skipped as nova is not available" % cls.__name__) raise cls.skipException(skip_msg) - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False diff --git a/congress_tempest_plugin/tests/scenario/manager.py b/congress_tempest_plugin/tests/scenario/manager.py index fed9c36..259c383 100644 --- a/congress_tempest_plugin/tests/scenario/manager.py +++ b/congress_tempest_plugin/tests/scenario/manager.py @@ -589,8 +589,8 @@ class NetworkScenarioTest(ScenarioTest): port_map = [(p["id"], fxip["ip_address"]) for p in ports for fxip in p["fixed_ips"] - if netutils.is_valid_ipv4(fxip["ip_address"]) - and p['status'] in p_status] + if netutils.is_valid_ipv4(fxip["ip_address"]) and + p['status'] in p_status] inactive = [p for p in ports if p['status'] != 'ACTIVE'] if inactive: LOG.warning("Instance has ports that are not ACTIVE: %s", inactive) diff --git a/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py b/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py index 880c9a3..c1b80cf 100644 --- a/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py +++ b/congress_tempest_plugin/tests/scenario/test_congress_basic_ops.py @@ -35,8 +35,8 @@ class TestPolicyBasicOps(manager_congress.ScenarioPolicyBase): @classmethod def skip_checks(cls): super(TestPolicyBasicOps, cls).skip_checks() - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False @@ -246,8 +246,8 @@ class TestCongressDataSources(manager_congress.ScenarioPolicyBase): @classmethod def skip_checks(cls): super(TestCongressDataSources, cls).skip_checks() - if not (CONF.network.project_networks_reachable - or CONF.network.public_network_id): + if not (CONF.network.project_networks_reachable or + CONF.network.public_network_id): msg = ('Either project_networks_reachable must be "true", or ' 'public_network_id must be defined.') cls.enabled = False diff --git a/test-requirements.txt b/test-requirements.txt index 0543291..43a96a3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD diff --git a/tox.ini b/tox.ini index 6b2b968..091681a 100644 --- a/tox.ini +++ b/tox.ini @@ -49,8 +49,9 @@ commands = oslo_debug_helper {posargs} [flake8] # E123, E125 skipped as they are invalid PEP-8. +# E731 skipped as assign a lambda expression show-source = True -ignore = E123,E125 +ignore = E123,E125,E731 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build