trivial: Mock warnings

These were being spewed by zuul.

Change-Id: Ifaf41d074d0b43a64c414a1d21cf17c3bbc9f2fa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2020-04-23 15:24:32 +01:00
parent 5655e7f7b2
commit b59f459d36

View File

@ -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')