Skip to content

Commit 9a29d75

Browse files
authored
Change assertRaises to assertRaisesRegex in test_xmlrpc (#481) (#675)
(cherry picked from commit c6b448b)
1 parent 0641ada commit 9a29d75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_xmlrpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,22 +364,22 @@ def test_registered_func_is_none(self):
364364

365365
dispatcher = xmlrpc.server.SimpleXMLRPCDispatcher()
366366
dispatcher.register_function(None, name='method')
367-
with self.assertRaises(Exception, expected_regex='method'):
367+
with self.assertRaisesRegex(Exception, 'method'):
368368
dispatcher._dispatch('method', ('param',))
369369

370370
def test_instance_has_no_func(self):
371371
"""Attempts to call nonexistent function on a registered instance"""
372372

373373
dispatcher = xmlrpc.server.SimpleXMLRPCDispatcher()
374374
dispatcher.register_instance(object())
375-
with self.assertRaises(Exception, expected_regex='method'):
375+
with self.assertRaisesRegex(Exception, 'method'):
376376
dispatcher._dispatch('method', ('param',))
377377

378378
def test_cannot_locate_func(self):
379379
"""Calls a function that the dispatcher cannot locate"""
380380

381381
dispatcher = xmlrpc.server.SimpleXMLRPCDispatcher()
382-
with self.assertRaises(Exception, expected_regex='method'):
382+
with self.assertRaisesRegex(Exception, 'method'):
383383
dispatcher._dispatch('method', ('param',))
384384

385385

0 commit comments

Comments
 (0)