]> granicus.if.org Git - python/commitdiff
Change assertRaises to assertRaisesRegex in test_xmlrpc (#481) (#675)
authorBerker Peksag <berker.peksag@gmail.com>
Wed, 15 Mar 2017 11:13:09 +0000 (14:13 +0300)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2017 11:13:09 +0000 (14:13 +0300)
(cherry picked from commit c6b448b36d22769c684bb3276f85c1b47d15ab63)

Lib/test/test_xmlrpc.py

index 7e023c167331967458c6c6936944a0fb31d9a4ea..c2de057ecbfaa4714f7e1be375435ee9ec742be3 100644 (file)
@@ -364,7 +364,7 @@ class SimpleXMLRPCDispatcherTestCase(unittest.TestCase):
 
         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):
@@ -372,14 +372,14 @@ class SimpleXMLRPCDispatcherTestCase(unittest.TestCase):
 
         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',))