From ee32ea5e2bf2b01104c5bde6b6a5018dd0e15f57 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 7 Apr 2016 19:15:01 +0200 Subject: [PATCH] Switched from fixtures to mock to mock out starting RPC consumers fixtures 2.0.0 broke us wildly, so instead of trying to make it work with new fixtures, I better just switch the mock to... mock. Change-Id: I58d7a750e263e4af54589ace07ac00bec34b553a Closes-Bug: #1567295 (cherry picked from commit 2af86b8f6f749bf7b42a2c04b48c9a2dc28a46c9) --- neutron/tests/base.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/neutron/tests/base.py b/neutron/tests/base.py index 2f5d57e860f..a303ed2479f 100644 --- a/neutron/tests/base.py +++ b/neutron/tests/base.py @@ -66,10 +66,6 @@ def fake_use_fatal_exceptions(*args): return True -def fake_consume_in_threads(self): - return [] - - def get_rand_name(max_length=None, prefix='test'): """Return a random string. @@ -318,9 +314,9 @@ class BaseTestCase(DietTestCase): def setup_rpc_mocks(self): # don't actually start RPC listeners when testing - self.useFixture(fixtures.MonkeyPatch( + mock.patch( 'neutron.common.rpc.Connection.consume_in_threads', - fake_consume_in_threads)) + return_value=[]).start() self.useFixture(fixtures.MonkeyPatch( 'oslo_messaging.Notifier', fake_notifier.FakeNotifier))