mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Change assertRaises to assertRaisesRegex in test_xmlrpc (#481)
This commit is contained in:
parent
b4e1b92aab
commit
c6b448b36d
1 changed files with 3 additions and 3 deletions
|
@ -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',))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue