Replace assertRaisesRegexp with assertRaisesRegex

assertRaisesRegexp was renamed to assertRaisesRegex in Py3.2
For more details, please check:
https://docs.python.org/3/library/
unittest.html#unittest.TestCase.assertRaisesRegex

Change-Id: Ie23bfb774afa2894a6c69f1be79e2d6d236ec2b0
This commit is contained in:
Vu Cong Tuan 2017-06-03 11:29:09 +07:00
parent d42a079a1a
commit 430fb92bbb

View File

@ -148,7 +148,7 @@ class DetachProcessUtilsTestCase(base.TestCase):
error_msg = 'Kare-a-tay!'
mock_fork.side_effect = OSError(error_msg)
with self.assertRaisesRegexp(exception.DetachProcessError, error_msg):
with self.assertRaisesRegex(exception.DetachProcessError, error_msg):
with utils.detach_process():
pass
@ -169,7 +169,7 @@ class DetachProcessUtilsTestCase(base.TestCase):
error_msg = 'Fish paste!'
mock_chdir.side_effect = Exception(error_msg)
with self.assertRaisesRegexp(exception.DetachProcessError, error_msg):
with self.assertRaisesRegex(exception.DetachProcessError, error_msg):
with utils.detach_process():
pass
@ -193,7 +193,7 @@ class DetachProcessUtilsTestCase(base.TestCase):
error_msg = 'Barnacles!'
mock_umask.side_effect = Exception(error_msg)
with self.assertRaisesRegexp(exception.DetachProcessError, error_msg):
with self.assertRaisesRegex(exception.DetachProcessError, error_msg):
with utils.detach_process():
pass