mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
#9424: Replace deprecated assert* methods in the Python test suite.
This commit is contained in:
parent
b8bc439b20
commit
b3aedd4862
170 changed files with 2388 additions and 2392 deletions
|
@ -44,7 +44,7 @@ class CommandTestCase(unittest.TestCase):
|
|||
|
||||
# making sure execute gets called properly
|
||||
def _execute(func, args, exec_msg, level):
|
||||
self.assertEquals(exec_msg, 'generating out from in')
|
||||
self.assertEqual(exec_msg, 'generating out from in')
|
||||
cmd.force = True
|
||||
cmd.execute = _execute
|
||||
cmd.make_file(infiles='in', outfile='out', func='func', args=())
|
||||
|
@ -63,7 +63,7 @@ class CommandTestCase(unittest.TestCase):
|
|||
|
||||
wanted = ["command options for 'MyCmd':", ' option1 = 1',
|
||||
' option2 = 1']
|
||||
self.assertEquals(msgs, wanted)
|
||||
self.assertEqual(msgs, wanted)
|
||||
|
||||
def test_ensure_string(self):
|
||||
cmd = self.cmd
|
||||
|
@ -81,7 +81,7 @@ class CommandTestCase(unittest.TestCase):
|
|||
cmd = self.cmd
|
||||
cmd.option1 = 'ok,dok'
|
||||
cmd.ensure_string_list('option1')
|
||||
self.assertEquals(cmd.option1, ['ok', 'dok'])
|
||||
self.assertEqual(cmd.option1, ['ok', 'dok'])
|
||||
|
||||
cmd.option2 = ['xxx', 'www']
|
||||
cmd.ensure_string_list('option2')
|
||||
|
@ -109,14 +109,14 @@ class CommandTestCase(unittest.TestCase):
|
|||
with captured_stdout() as stdout:
|
||||
cmd.debug_print('xxx')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), '')
|
||||
self.assertEqual(stdout.read(), '')
|
||||
|
||||
debug.DEBUG = True
|
||||
try:
|
||||
with captured_stdout() as stdout:
|
||||
cmd.debug_print('xxx')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), 'xxx\n')
|
||||
self.assertEqual(stdout.read(), 'xxx\n')
|
||||
finally:
|
||||
debug.DEBUG = False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue