Ubuntu Pastebin

Paste from smoser at Thu, 7 Dec 2017 20:48:00 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index feb884ab..7bab15c6 100644
--- a/cloudinit/tests/helpers.py
+++ b/cloudinit/tests/helpers.py
@@ -395,4 +395,9 @@ if not hasattr(mock.Mock, 'assert_not_called'):
     mock.Mock.assert_not_called = __mock_assert_not_called
 
 
+# older unittest2.TestCase (centos6) do not have assertRaisesRegex
+if not hasattr(unittest.TestCase2, 'assertRaisesRegex'):
+    unittest.TestCase2.assertRaisesRegex = unittest.TestCase2.assertRaisesRegexp
+
+
 # vi: ts=4 expandtab
Download as text