Move heat-translator to new hacking 4.0.0

Hacking 4.0.0 has introduce new optimal assert checks.
Please refer [1] for more details.

Additionally Hacking has enabled some new checks by default,
and the next update to the new release will introduce failures
in heat-translator pep8 jobs.
The main impact is from I122d250cab90964c346e9d53046a97c25054bc00.

This patch adopts new optimal assert check.
  [H211]:  Change assertTrue(isinstance(A, B)) to
           assertIsInstance(A, B).

On bumping up the hacking version, below mention pep8 jobs failed.
This patch address the issues now, when the new hacking release starts
being used it will not cause a disruption.

pep8 run-test: commands[0] | flake8
./translator/tests/test_utils.py:51:13: H211: Use assert{Is,IsNot}instance
         self.assertTrue(

[1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-4-0-0

Change-Id: Iae79b8c5c6873d6bf5f6ef1b427dc8c60bade03f
This commit is contained in:
Manpreet Kaur 2021-01-26 13:53:00 +05:30
parent 4809045ed5
commit 6687b35b46
2 changed files with 2 additions and 3 deletions

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>=3.0.1,<3.1.0 # Apache-2.0
hacking>=4.0.0,<4.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0

View File

@ -48,8 +48,7 @@ class CommonUtilsTest(TestCase):
try:
self.MemoryUnit.validate_unit(unit)
except Exception as err:
self.assertTrue(
isinstance(err, ValueError))
self.assertIsInstance(err, ValueError)
self.assertEqual(exp_msg, err.__str__())
def test_unit_size_conversion_to_GNU_standard(self):