Use python-six shim for assertRaisesRegex/p

Python2 uses assertRaisesRegexp while Python3 uses assertRaisesRegex.
Use the compatability shim in six for this:
https://pythonhosted.org/six/#unittest-assertions

Change-Id: I28ce94207567e0b3c28c634119757a1d68e955f2
Closes-Bug: #1462370
This commit is contained in:
Corey Bryant
2015-06-05 09:41:06 -04:00
parent 7f407488ce
commit 2a032a5f37

View File

@@ -244,7 +244,8 @@ class SessionTests(utils.TestCase):
# The exception should contain the URL and details about the SSL error
msg = _('SSL exception connecting to %(url)s: %(error)s') % {
'url': self.TEST_URL, 'error': error}
self.assertRaisesRegex(exceptions.SSLError,
six.assertRaisesRegex(self,
exceptions.SSLError,
msg,
session.get,
self.TEST_URL)