From b59f459d361ce933cf5465516f641ac8f6f4b0c3 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 23 Apr 2020 15:24:32 +0100 Subject: [PATCH] trivial: Mock warnings These were being spewed by zuul. Change-Id: Ifaf41d074d0b43a64c414a1d21cf17c3bbc9f2fa Signed-off-by: Stephen Finucane --- oslo_versionedobjects/tests/test_fields.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/oslo_versionedobjects/tests/test_fields.py b/oslo_versionedobjects/tests/test_fields.py index c23b3e79..0b2ea9d9 100644 --- a/oslo_versionedobjects/tests/test_fields.py +++ b/oslo_versionedobjects/tests/test_fields.py @@ -292,11 +292,12 @@ class TestUUID(TestField): self.to_primitive_values = self.coerce_good_values[0:1] self.from_primitive_values = self.coerce_good_values[0:1] - def test_validation_enabled(self): - - self.test_coerce_good_values() - self.test_from_primitive() - self.test_to_primitive() + @mock.patch('warnings.warn') + def test_coerce_good_values(self, mock_warn): + super().test_coerce_good_values() + mock_warn.assert_has_calls( + [mock.call(mock.ANY, FutureWarning)] * 8, + ) def test_validation_warning_can_be_escalated_to_exception(self): warnings.filterwarnings(action='error')