]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Use assertRaisesRegexp() in test_srb.py.
authorCorey Bryant <corey.bryant@canonical.com>
Mon, 5 Jan 2015 19:53:48 +0000 (14:53 -0500)
committerCorey Bryant <corey.bryant@canonical.com>
Mon, 5 Jan 2015 21:13:37 +0000 (16:13 -0500)
Python >= 2.7 should be using assertRaisesRegexp()
rather than assertRaisesRegex().

Change-Id: I033b88d50cf90503e1123a9871c1bc252d914c06
Closes-Bug: 1407781

cinder/tests/test_srb.py

index 91783fa510bf540e4f13e2561a53a310ed125244..b084c2680215652b16c0d80d91d1baa14a48e139 100644 (file)
@@ -211,7 +211,8 @@ class TestHandleProcessExecutionError(test.TestCase):
                     message='', info_message='', reraise=True):
                 raise processutils.ProcessExecutionError(description='Oops')
 
-        self.assertRaisesRegex(processutils.ProcessExecutionError, r'^Oops', f)
+        self.assertRaisesRegexp(processutils.ProcessExecutionError,
+                                r'^Oops', f)
 
     def test_reraise_false(self):
         with srb.handle_process_execution_error(
@@ -224,7 +225,7 @@ class TestHandleProcessExecutionError(test.TestCase):
                     message='', info_message='', reraise=RuntimeError('Oops')):
                 raise processutils.ProcessExecutionError
 
-        self.assertRaisesRegex(RuntimeError, r'^Oops', f)
+        self.assertRaisesRegexp(RuntimeError, r'^Oops', f)
 
 
 class SRBDriverTestCase(test.TestCase):