Revert "Tests: Fail if oslo.versionedobjects issues Invalid UUID warnings"
This is currently causing unit test failures since pymysql _show_warnings calls warnings.warn(err.Warning(*w[1:3]), stacklevel=4) and this code assumes that the warnings are strings. This reverts commited6d50bed6
. Change-Id: I81dc6f1ac5855b21c10572797fd45a6b38641112 (cherry picked from commitcc6c5b1086
)
This commit is contained in:
parent
f3f3fb3c49
commit
23377ac9a8
|
@ -228,7 +228,6 @@ class TestCase(testtools.TestCase):
|
||||||
group='oslo_policy')
|
group='oslo_policy')
|
||||||
|
|
||||||
self._disable_osprofiler()
|
self._disable_osprofiler()
|
||||||
self._disallow_invalid_uuids()
|
|
||||||
|
|
||||||
# NOTE(geguileo): This is required because common get_by_id method in
|
# NOTE(geguileo): This is required because common get_by_id method in
|
||||||
# cinder.db.sqlalchemy.api caches get methods and if we use a mocked
|
# cinder.db.sqlalchemy.api caches get methods and if we use a mocked
|
||||||
|
@ -257,17 +256,6 @@ class TestCase(testtools.TestCase):
|
||||||
return_value=mock_decorator)
|
return_value=mock_decorator)
|
||||||
p.start()
|
p.start()
|
||||||
|
|
||||||
def _disallow_invalid_uuids(self):
|
|
||||||
def catch_uuid_warning(message, *args, **kwargs):
|
|
||||||
ovo_message = "invalid UUID. Using UUIDFields with invalid UUIDs " \
|
|
||||||
"is no longer supported"
|
|
||||||
if ovo_message in message:
|
|
||||||
raise AssertionError(message)
|
|
||||||
|
|
||||||
p = mock.patch("warnings.warn",
|
|
||||||
side_effect=catch_uuid_warning)
|
|
||||||
p.start()
|
|
||||||
|
|
||||||
def _common_cleanup(self):
|
def _common_cleanup(self):
|
||||||
"""Runs after each test method to tear down test environment."""
|
"""Runs after each test method to tear down test environment."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue