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

florent.xicluna python-checkins at python.org
Fri Mar 5 02:05:55 CET 2010


Author: florent.xicluna
Date: Fri Mar  5 02:05:55 2010
New Revision: 78673

Log:
Let's use assertIsNone / assertIsNotNone. It's hype.


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	Fri Mar  5 02:05:55 2010
@@ -655,17 +655,16 @@
 
         # Let the process initialize correctly (Issue #3137)
         time.sleep(0.1)
-        self.assertIs(p.poll(), None)
+        self.assertIsNone(p.poll())
         count, maxcount = 0, 3
         # Retry if the process do not receive the SIGINT signal.
         while count < maxcount and p.poll() is None:
             p.send_signal(signal.SIGINT)
             time.sleep(0.1)
             count += 1
-        if p.poll() is None:
-            raise test_support.TestFailed("the subprocess did not receive "
-                                          "the signal SIGINT")
-        elif count > 1:
+        self.assertIsNotNone(p.poll(), "the subprocess did not receive "
+                                       "the signal SIGINT")
+        if count > 1:
             print >>sys.stderr, ("p.send_signal(SIGINT) succeeded "
                                  "after {} attempts".format(count))
         self.assertNotEqual(p.wait(), 0)
@@ -824,6 +823,7 @@
                   ProcessTestCaseNoPoll,
                   HelperFunctionTests)
 
+    unit_tests = (                  POSIXProcessTestCase,)
     test_support.run_unittest(*unit_tests)
     test_support.reap_children()
 


More information about the Python-checkins mailing list