Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Unified Diff: Lib/test/test_subprocess.py

Issue 3232042: #9424: convert deprecated assert methods in the Python test suite Base URL: http://svn.python.org/projects/python/branches/py3k/
Patch Set: Minor cleanups Created 14 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_structmembers.py ('k') | Lib/test/test_sys.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Lib/test/test_subprocess.py
===================================================================
--- Lib/test/test_subprocess.py (revision 86567)
+++ Lib/test/test_subprocess.py (working copy)
@@ -591,7 +591,7 @@
"[sys.executable, '-c', 'print(\"Hello World!\")'])",
'assert retcode == 0'))
output = subprocess.check_output([sys.executable, '-c', code])
- self.assert_(output.startswith(b'Hello World!'), ascii(output))
+ self.assertTrue(output.startswith(b'Hello World!'), ascii(output))
def test_handles_closed_on_exception(self):
# If CreateProcess exits with an error, ensure the
@@ -927,7 +927,7 @@
[sys.executable, "-c", script],
env=env)
stdout = stdout.rstrip(b'\n\r')
- self.assertEquals(stdout.decode('ascii'), ascii(value))
+ self.assertEqual(stdout.decode('ascii'), ascii(value))
# test bytes
key = key.encode("ascii", "surrogateescape")
@@ -939,7 +939,7 @@
[sys.executable, "-c", script],
env=env)
stdout = stdout.rstrip(b'\n\r')
- self.assertEquals(stdout.decode('ascii'), ascii(value))
+ self.assertEqual(stdout.decode('ascii'), ascii(value))
def test_bytes_program(self):
abs_program = os.fsencode(sys.executable)
@@ -948,19 +948,19 @@
# absolute bytes path
exitcode = subprocess.call([abs_program, "-c", "pass"])
- self.assertEquals(exitcode, 0)
+ self.assertEqual(exitcode, 0)
# bytes program, unicode PATH
env = os.environ.copy()
env["PATH"] = path
exitcode = subprocess.call([program, "-c", "pass"], env=env)
- self.assertEquals(exitcode, 0)
+ self.assertEqual(exitcode, 0)
# bytes program, bytes PATH
envb = os.environb.copy()
envb[b"PATH"] = os.fsencode(path)
exitcode = subprocess.call([program, "-c", "pass"], env=envb)
- self.assertEquals(exitcode, 0)
+ self.assertEqual(exitcode, 0)
@unittest.skipUnless(mswindows, "Windows specific tests")
« no previous file with comments | « Lib/test/test_structmembers.py ('k') | Lib/test/test_sys.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b