]> granicus.if.org Git - python/commitdiff
Change assertRaises to assertRaisesRegex in test_xmlrpc (#481)
authorDillon Brock <okay19@users.noreply.github.com>
Sun, 5 Mar 2017 17:27:06 +0000 (12:27 -0500)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 5 Mar 2017 17:27:06 +0000 (19:27 +0200)
Lib/test/test_xmlrpc.py

index 57a1efc1fe1a24ada863a9b40c275294cfd600fa..74a46ba883a911e1f4bda21bb833b8011947220d 100644 (file)
@@ -412,7 +412,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):
@@ -420,14 +420,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',))