Move tosca-parser 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 tosca-parser 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
./toscaparser/tests/test_toscatplvalidation.py:502:13:
                                   H211: Use assert{Is,IsNot}instance

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

Change-Id: I5c83168267be63d4b3908ce6bb844a64bcee837d
This commit is contained in:
Manpreet Kaur 2021-01-26 16:26:10 +05:30
parent df16f011f0
commit ce8fa0f8bc
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

@ -499,8 +499,7 @@ heat-translator/master/translator/tests/data/custom_types/wordpress.yaml
try:
output.validate()
except Exception as err:
self.assertTrue(
isinstance(err, exception.MissingRequiredFieldError))
self.assertIsInstance(err, exception.MissingRequiredFieldError)
self.assertEqual(_('Output "server_address" is missing required '
'field "value".'), err.__str__())