Replace assertRaisesRegexp with assertRaisesRegex

This replaces the deprecated (in python 3.2) unittest.TestCase method
assertRaisesRegexp() with assertRaisesRegex().

Change-Id: I8af9ce756cb4824d2b91fc7655d617dcd4d270cf
Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
Chuck Short 2018-08-27 09:52:40 -04:00
parent 716ca5e5f1
commit bbb450a7e0
1 changed files with 4 additions and 4 deletions

View File

@ -220,10 +220,10 @@ class LinuxSCSITestCase(base.TestCase):
@mock.patch.object(time, 'sleep')
def test_wait_for_path_not_found(self, exists_mock, sleep_mock):
path = "/dev/disk/by-id/dm-uuid-mpath-%s" % '1234567890'
self.assertRaisesRegexp(exception.VolumeDeviceNotFound,
r'Volume device not found at %s' % path,
self.linuxscsi.wait_for_path,
path)
self.assertRaisesRegex(exception.VolumeDeviceNotFound,
r'Volume device not found at %s' % path,
self.linuxscsi.wait_for_path,
path)
@ddt.data({'do_raise': False, 'force': False},
{'do_raise': True, 'force': True})