Change assertRaises to assertRaisesRegex in test_xmlrpc (#481) (#674)
(cherry picked from commit c6b448b36d22769c684bb3276f85c1b47d15ab63)
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 69de08e..30025e3 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -412,7 +412,7 @@
dispatcher = xmlrpc.server.SimpleXMLRPCDispatcher()
dispatcher.register_function(None, name='method')
- with self.assertRaises(Exception, expected_regex='method'):
+ with self.assertRaisesRegex(Exception, 'method'):
dispatcher._dispatch('method', ('param',))
def test_instance_has_no_func(self):
@@ -420,14 +420,14 @@
dispatcher = xmlrpc.server.SimpleXMLRPCDispatcher()
dispatcher.register_instance(object())
- with self.assertRaises(Exception, expected_regex='method'):
+ with self.assertRaisesRegex(Exception, 'method'):
dispatcher._dispatch('method', ('param',))
def test_cannot_locate_func(self):
"""Calls a function that the dispatcher cannot locate"""
dispatcher = xmlrpc.server.SimpleXMLRPCDispatcher()
- with self.assertRaises(Exception, expected_regex='method'):
+ with self.assertRaisesRegex(Exception, 'method'):
dispatcher._dispatch('method', ('param',))