Merge "Ignore UserWarning for scope checks during test runs"

This commit is contained in:
Zuul 2018-06-15 22:46:05 +00:00 committed by Gerrit Code Review
commit 55371110ae
2 changed files with 8 additions and 0 deletions

View File

@ -762,6 +762,10 @@ class WarningsFixture(fixtures.Fixture):
# about any deprecations coming from it
warnings.filterwarnings('ignore',
module='mox3.mox')
# NOTE(mriedem): Ignore scope check UserWarnings from oslo.policy.
warnings.filterwarnings('ignore',
message="Policy .* failed scope check",
category=UserWarning)
self.addCleanup(warnings.resetwarnings)

View File

@ -53,6 +53,9 @@ class APIFixture(fixture.GabbiFixture):
self.standard_logging_fixture.setUp()
self.output_stream_fixture = fixtures.OutputStreamCapture()
self.output_stream_fixture.setUp()
# Filter ignorable warnings during test runs.
self.warnings_fixture = fixtures.WarningsFixture()
self.warnings_fixture.setUp()
self.conf = CONF
self.conf.set_override('auth_strategy', 'noauth2', group='api')
@ -110,6 +113,7 @@ class APIFixture(fixture.GabbiFixture):
# are flushed.
self._reset_db_flags()
self.warnings_fixture.cleanUp()
self.output_stream_fixture.cleanUp()
self.standard_logging_fixture.cleanUp()
if self.conf: