Merge "tests: Enable UserWarning by default"

This commit is contained in:
Zuul
2023-07-28 16:28:43 +00:00
committed by Gerrit Code Review
2 changed files with 8 additions and 3 deletions

View File

@@ -34,6 +34,9 @@ class WarningsFixture(fixtures.Fixture):
self._original_warning_filters = warnings.filters[:]
# enable user warnings as many libraries use this (it's the default)
warnings.simplefilter("error", UserWarning)
# enable deprecation warnings in general...
warnings.simplefilter("once", DeprecationWarning)

View File

@@ -14,6 +14,7 @@ import copy
import queue
from unittest import mock
from keystoneauth1 import session
from testscenarios import load_tests_apply_scenarios as load_tests # noqa
from openstack import exceptions
@@ -622,7 +623,7 @@ class TestProxyCache(base.TestCase):
cloud_config_fixture='clouds_cache.yaml'
)
self.session = mock.Mock()
self.session = mock.Mock(spec=session.Session)
self.session._sdk_connection = self.cloud
self.session.get_project_id = mock.Mock(return_value='fake_prj')
@@ -651,10 +652,11 @@ class TestProxyCache(base.TestCase):
connect_retries=mock.ANY,
raise_exc=mock.ANY,
global_request_id=mock.ANY,
endpoint_filter=mock.ANY,
headers=mock.ANY,
microversion=mock.ANY,
params=mock.ANY,
endpoint_filter=mock.ANY,
headers=mock.ANY,
rate_semaphore=mock.ANY,
)
self.assertIn(self._get_key(1), self.cloud._api_cache_keys)