Bump to hacking 2.x

This is compatible with Python 3-only syntax.

Change-Id: I462f4242b9a5f8d8cd6b0cb3d328dfd9d93ba200
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2020-02-20 09:46:55 +00:00
parent c4c44bcb2d
commit 8f50f84981
7 changed files with 11 additions and 11 deletions

View File

@ -288,7 +288,7 @@ class TestServersDetailsFlavorInfo(base.ClientTestBase):
flavor_details, key)
server_flavor_val = self._get_value_from_the_table(
server_details, flavor_key_mapping[key])
if key is "swap" and flavor_val is "":
if key == "swap" and flavor_val == "":
# "flavor-show" displays zero swap as empty string.
flavor_val = '0'
self.assertEqual(flavor_val, server_flavor_val)

View File

@ -433,7 +433,7 @@ class ShellTest(utils.TestCase):
if required is None:
required = [
'.*?^usage: ',
'.*?^\s+set-password\s+Change the admin password',
'.*?^\\s+set-password\\s+Change the admin password',
'.*?^See "nova help COMMAND" for help on a specific command',
]
stdout, stderr = self.shell(command)

View File

@ -44,6 +44,7 @@ def _patch_mock_to_raise_for_invalid_assert_calls():
mock.Mock.__getattr__ = raise_for_invalid_assert_calls(
mock.Mock.__getattr__)
# NOTE(gibi): needs to be called only once at import time
# to patch the mock lib
_patch_mock_to_raise_for_invalid_assert_calls()

View File

@ -1062,7 +1062,7 @@ class ShellTest(utils.TestCase):
cmd = ('boot --image %s --flavor 1 '
'--nic net-name=blank some-server' % FAKE_UUID_1)
# this should raise a multiple matches error
msg = 'No Network matching blank\..*'
msg = 'No Network matching blank\\..*'
with testtools.ExpectedException(exceptions.CommandError, msg):
self.run_command(cmd)

View File

@ -3112,11 +3112,10 @@ def _print_absolute_limits(limits):
limit_list = []
for name in limit_names:
l = Limit(name,
used.get(name, "-"),
max.get(name, "-"),
other.get(name, "-"))
limit_list.append(l)
limit_list.append(Limit(
name, used.get(name, '-'), max.get(name, '-'),
other.get(name, '-'),
))
utils.print_list(limit_list, columns)

View File

@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<1.2.0 # Apache-2.0
hacking>=2.0.0,<2.1.0 # Apache-2.0
bandit>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0

View File

@ -88,8 +88,8 @@ commands =
#
# Following checks are ignored on purpose.
#
# Additional checks are also ignored on purpose: F811, F821
ignore = E731,F811,F821,H404,H405
# Additional checks are also ignored on purpose: F811, F821, W504
ignore = E731,F811,F821,H404,H405,W504
show-source = true
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,doc/source/conf.py,releasenotes