From 23377ac9a84f57c463653efc4b90f789d6f5cf3d Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 23 Oct 2017 15:44:02 -0400 Subject: [PATCH] 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 commit ed6d50bed642b01d005563866ab9f211632cff5b. Change-Id: I81dc6f1ac5855b21c10572797fd45a6b38641112 (cherry picked from commit cc6c5b10867544ec0e2cbc73802ec8ee6213bc7a) --- cinder/test.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cinder/test.py b/cinder/test.py index 2972a9f476b..7c7e11e81a9 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -228,7 +228,6 @@ class TestCase(testtools.TestCase): group='oslo_policy') self._disable_osprofiler() - self._disallow_invalid_uuids() # 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 @@ -257,17 +256,6 @@ class TestCase(testtools.TestCase): return_value=mock_decorator) 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): """Runs after each test method to tear down test environment."""