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:
parent
d42a079a1a
commit
430fb92bbb
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user