]> granicus.if.org Git - python/commitdiff
#2777: Apply same recipe for test_terminate and test_kill, i.e. close or redirect...
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Mar 2010 00:16:57 +0000 (00:16 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Mar 2010 00:16:57 +0000 (00:16 +0000)
Lib/test/test_subprocess.py

index 7437e6c3fb5c7a74f1bb6e809d8e86f0302236b8..cd378a231dfa463492e1d5a2caa1ee48a1fa29f3 100644 (file)
@@ -673,14 +673,16 @@ class POSIXProcessTestCase(unittest.TestCase):
         self.assertNotEqual(p.wait(), 0)
 
     def test_kill(self):
-        p = subprocess.Popen([sys.executable, "-c", "input()"])
+        p = subprocess.Popen([sys.executable, "-c", "input()"],
+                             stdin=subprocess.PIPE, close_fds=True)
 
         self.assertIsNone(p.poll())
         p.kill()
         self.assertEqual(p.wait(), -signal.SIGKILL)
 
     def test_terminate(self):
-        p = subprocess.Popen([sys.executable, "-c", "input()"])
+        p = subprocess.Popen([sys.executable, "-c", "input()"],
+                             stdin=subprocess.PIPE, close_fds=True)
 
         self.assertIsNone(p.poll())
         p.terminate()