Skip to content

Commit

Permalink
Change assertRaises to assertRaisesRegex in test_xmlrpc (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Brock authored and serhiy-storchaka committed Mar 5, 2017
1 parent b4e1b92 commit c6b448b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/test/test_xmlrpc.py
Expand Up @@ -412,22 +412,22 @@ def test_registered_func_is_none(self):

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):
"""Attempts to call nonexistent function on a registered instance"""

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',))


Expand Down

0 comments on commit c6b448b

Please sign in to comment.