From e349c5e6f2d3e6909856a493b7b05827d7eec7c8 Mon Sep 17 00:00:00 2001
From: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Date: Wed, 18 Jun 2014 17:17:06 +0200
Subject: [PATCH] Disable connection pool in qpid interfaces tests

This change disables the connection pool in qpid interfaces tests to
ensure that each tests are isolated.

Closes bug: #1331459

Change-Id: Ib4a49be9f605dda5f2cbcbade3851345866e5797
---
 tests/test_qpid.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/test_qpid.py b/tests/test_qpid.py
index 08b7a2226..1af716286 100644
--- a/tests/test_qpid.py
+++ b/tests/test_qpid.py
@@ -482,6 +482,13 @@ class TestDriverInterface(_QpidBaseTestCase):
         transport = messaging.get_transport(self.conf)
         self.driver = transport._driver
 
+        original_get_connection = self.driver._get_connection
+        p = mock.patch.object(self.driver, '_get_connection',
+                              side_effect=lambda pooled=True:
+                              original_get_connection(False))
+        p.start()
+        self.addCleanup(p.stop)
+
     def test_listen_and_direct_send(self):
         target = messaging.Target(exchange="exchange_test",
                                   topic="topic_test",