From 8d571261fb0355f42d06300b0894eb5a15b664b4 Mon Sep 17 00:00:00 2001
From: Sean Dague <sean@dague.net>
Date: Mon, 24 Jul 2017 13:15:30 -0400
Subject: [PATCH] Suppress some test warnings

Because we capture stderr during test runs we see warnings that we
have no ability to really impact. 3 of these should just be further
suppressed.

1) Anything dealing with pkg_resources, we consume this through
intermediary layers only, and these warnings have been around forever.

2) Policy enforcement warnings, as is_admin was deprecated well before
there was a transition forward.

3) Anything out of mox3. We're just trying to delete this. No one is
fixing that module as it's effectively dead.

Change-Id: I5eaf953b6a2b0a3efe215f776aa048433b192e90
---
 nova/tests/fixtures.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py
index 6609e5f83..eed741069 100644
--- a/nova/tests/fixtures.py
+++ b/nova/tests/fixtures.py
@@ -718,6 +718,21 @@ class WarningsFixture(fixtures.Fixture):
         warnings.filterwarnings('ignore',
                                 message='With-statements now directly support'
                                         ' multiple context managers')
+        # NOTE(sdague): nova does not use pkg_resources directly, this
+        # is all very long standing deprecations about other tools
+        # using it. None of this is useful to Nova development.
+        warnings.filterwarnings('ignore',
+            module='pkg_resources')
+        # NOTE(sdague): this remains an unresolved item around the way
+        # forward on is_admin, the deprecation is definitely really premature.
+        warnings.filterwarnings('ignore',
+            message='Policy enforcement is depending on the value of is_admin.'
+                    ' This key is deprecated. Please update your policy '
+                    'file to use the standard policy values.')
+        # NOTE(sdague): mox3 is on life support, don't really care
+        # about any deprecations coming from it
+        warnings.filterwarnings('ignore',
+            module='mox3.mox')
 
         self.addCleanup(warnings.resetwarnings)