From 89170bc2a922cb5f6005b8970770fdca31e38296 Mon Sep 17 00:00:00 2001 From: Andrew Lazarev Date: Fri, 13 Jun 2014 15:35:33 -0700 Subject: [PATCH] Hided not found logger messages in unit tests Hided messages "No handlers could be found for logger ..." from unit tests output. Change-Id: I2f997a589407c45a60848297513da95f847bd66c Closes-Bug: #1264005 --- sahara/tests/unit/base.py | 2 ++ sahara/tests/unit/test_context.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sahara/tests/unit/base.py b/sahara/tests/unit/base.py index 1e046341..2640a4a8 100644 --- a/sahara/tests/unit/base.py +++ b/sahara/tests/unit/base.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import fixtures import mock import testtools @@ -26,6 +27,7 @@ class SaharaTestCase(testtools.TestCase): def setUp(self): super(SaharaTestCase, self).setUp() + self.useFixture(fixtures.FakeLogger('sahara')) self.setup_context() def setup_context(self, username="test_user", tenant_id="tenant_1", diff --git a/sahara/tests/unit/test_context.py b/sahara/tests/unit/test_context.py index 6e7a91d6..e6cd94be 100644 --- a/sahara/tests/unit/test_context.py +++ b/sahara/tests/unit/test_context.py @@ -15,6 +15,7 @@ import random +import fixtures import mock import six import testtools @@ -29,6 +30,7 @@ rnd = random.Random() class ContextTest(testtools.TestCase): def setUp(self): super(ContextTest, self).setUp() + self.useFixture(fixtures.FakeLogger('sahara')) ctx = context.Context('test_user', 'tenant_1', 'test_auth_token', {}, remote_semaphore='123') context.set_ctx(ctx)