From 21b0e716ac96bc78aee499ddb4eeb08882c45615 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Wed, 9 Dec 2015 11:02:47 -0500 Subject: [PATCH] Enable py3 mock.patch of RuntimeError RuntimeError is moved to builtins in Python3.x so adjust the @mock.patch accordingly when running in Python3.x. Change-Id: I5e1ce3ed40add635ce25bc1d80f88dc7ad9d2c59 Closes-Bug: #1522551 --- oslo_service/tests/test_sslutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_service/tests/test_sslutils.py b/oslo_service/tests/test_sslutils.py index 6dd7bf42..7f299103 100644 --- a/oslo_service/tests/test_sslutils.py +++ b/oslo_service/tests/test_sslutils.py @@ -38,7 +38,7 @@ class SslutilsTestCase(base.ServiceBaseTestCase): self.key_file_name = os.path.join(SSL_CERT_DIR, 'privatekey.key') self.ca_file_name = os.path.join(SSL_CERT_DIR, 'ca.crt') - @mock.patch("exceptions.RuntimeError") + @mock.patch("%s.RuntimeError" % RuntimeError.__module__) @mock.patch("os.path.exists") def test_is_enabled(self, exists_mock, runtime_error_mock): exists_mock.return_value = True