From 9a079d816ab22ea14854dab2fe814143f3bcc5e9 Mon Sep 17 00:00:00 2001
From: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Date: Wed, 18 Jun 2014 15:16:10 +0200
Subject: [PATCH] Removes contextlib.nested

This change removes usage of contextlib.nested that is not
python 3 compatible

Change-Id: Id69b4112a1bbfe06a53dd68ed94f15fd1d58ba74
---
 tests/test_notifier.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tests/test_notifier.py b/tests/test_notifier.py
index c902a71e8..3c0442cc9 100644
--- a/tests/test_notifier.py
+++ b/tests/test_notifier.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import contextlib
 import datetime
 import logging
 import sys
@@ -528,11 +527,10 @@ group_1:
              extension.Extension('bar', None, None, bar_driver)],
         )
 
-        with contextlib.nested(
-            mock.patch.object(self.router, '_get_notifier_config_file',
-                              config_file),
-            mock.patch('stevedore.dispatch.DispatchExtensionManager',
-                       return_value=pm)):
+        with mock.patch.object(self.router, '_get_notifier_config_file',
+                               config_file):
+            with mock.patch('stevedore.dispatch.DispatchExtensionManager',
+                            return_value=pm):
                 self.notifier.info({}, 'my_event', {})
                 self.assertFalse(bar_driver.info.called)
                 rpc_driver.notify.assert_called_once_with(