[Python-checkins] r78789 - python/trunk/Lib/test/test_subprocess.py

florent.xicluna python-checkins at python.org
Mon Mar 8 11:59:33 CET 2010


Author: florent.xicluna
Date: Mon Mar  8 11:59:33 2010
New Revision: 78789

Log:
Replace the stderr logging with assertNotEqual(returncode, 0).


Modified:
   python/trunk/Lib/test/test_subprocess.py

Modified: python/trunk/Lib/test/test_subprocess.py
==============================================================================
--- python/trunk/Lib/test/test_subprocess.py	(original)
+++ python/trunk/Lib/test/test_subprocess.py	Mon Mar  8 11:59:33 2010
@@ -770,7 +770,7 @@
         p = subprocess.Popen([sys.executable, "-c", "input()"],
                              stdin=subprocess.PIPE)
 
-        # Let the process initialize
+        # Let the process initialize (Issue #3137)
         time.sleep(0.1)
         # The process should not terminate prematurely
         self.assertIsNone(p.poll())
@@ -786,10 +786,8 @@
         if count > 1:
             print >>sys.stderr, ("p.{}{} succeeded after "
                                  "{} attempts".format(method, args, count))
-        if returncode == 0:
-            # On some win32 platforms, it returns 0. See #2777.
-            print >>sys.stderr, "p.{}{} returned 0".format(method, args)
         self.assertEqual(p.wait(), returncode)
+        self.assertNotEqual(returncode, 0)
 
     def test_send_signal(self):
         self._kill_process('send_signal', signal.SIGTERM)


More information about the Python-checkins mailing list