diff options
author | Corey Bryant <corey.bryant@canonical.com> | 2021-12-13 10:50:53 -0500 |
---|---|---|
committer | Corey Bryant <corey.bryant@canonical.com> | 2021-12-13 11:21:07 -0500 |
commit | 80453f9136e1db04c9a4f77a81b9d368b95bd6de (patch) | |
tree | ad8f012e85f3d6da669af00cced29dca9ff45e55 | |
parent | fe8fba8c9823fd001524fe8a2a59b6be201faec4 (diff) | |
download | heat-80453f9136e1db04c9a4f77a81b9d368b95bd6de.tar.gz |
Adjust self.assertRaisesRegex messages for py310
The messages returned are slightly different when run
with Python 3.10.
Story: 2009741
Task: 44177
Change-Id: I26917aefdf43bf3f9008891d2e66aef9b94f58b5
-rw-r--r-- | heat/tests/openstack/aodh/test_alarm.py | 6 | ||||
-rw-r--r-- | heat/tests/test_properties.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/heat/tests/openstack/aodh/test_alarm.py b/heat/tests/openstack/aodh/test_alarm.py index cb5b6fb53..a75f2382c 100644 --- a/heat/tests/openstack/aodh/test_alarm.py +++ b/heat/tests/openstack/aodh/test_alarm.py @@ -391,12 +391,12 @@ class AodhAlarmTest(common.HeatTestCase): resource_defns = stack.t.resource_definitions(stack) rsrc = alarm.AodhAlarm( 'MEMAlarmHigh', resource_defns['MEMAlarmHigh'], stack) - # python 3.4.3 returns another error message - # so try to handle this by regexp + # python 3.4.3 and python3.10 return slightly different error + # messages, so try to handle this by regexp msg = ("Property error: Resources.MEMAlarmHigh.Properties.%s: " r"int\(\) argument must be a string" "(, a bytes-like object)?" - " or a number, not 'list'" % p) + " or a (real )?number, not 'list'" % p) self.assertRaisesRegex(exception.StackValidationFailed, msg, rsrc.validate) diff --git a/heat/tests/test_properties.py b/heat/tests/test_properties.py index 97f8a8027..8e780f73e 100644 --- a/heat/tests/test_properties.py +++ b/heat/tests/test_properties.py @@ -783,12 +783,12 @@ class PropertyTest(common.HeatTestCase): def test_int_bad(self): schema = {'Type': 'Integer'} p = properties.Property(schema) - # python 3.4.3 returns another error message + # python 3.4.3 and python3.10 return slightly different error messages # try to handle this by regexp self.assertRaisesRegex( TypeError, r"int\(\) argument must be a string" "(, a bytes-like object)?" - " or a number, not 'list'", p.get_value, [1]) + " or a (real )?number, not 'list'", p.get_value, [1]) def test_str_from_int(self): schema = {'Type': 'String'} |