Index: Lib/test/test_subprocess.py =================================================================== --- ../../../Python-2.6.3_/Python-2.6.3/Lib/test/test_subprocess.py 2009-02-14 18:04:26.000000000 +0100 +++ test_subprocess.py 2009-10-15 16:32:40.000000000 +0200 @@ -614,7 +614,7 @@ os.remove(fname) self.assertEqual(rc, 47) - def DISABLED_test_send_signal(self): + def test_send_signal(self): p = subprocess.Popen([sys.executable, "-c", "input()"]) @@ -622,7 +622,7 @@ p.send_signal(signal.SIGINT) self.assertNotEqual(p.wait(), 0) - def DISABLED_test_kill(self): + def test_kill(self): p = subprocess.Popen([sys.executable, "-c", "input()"]) @@ -630,7 +630,7 @@ p.kill() self.assertEqual(p.wait(), -signal.SIGKILL) - def DISABLED_test_terminate(self): + def test_terminate(self): p = subprocess.Popen([sys.executable, "-c", "input()"]) @@ -638,6 +638,14 @@ p.terminate() self.assertEqual(p.wait(), -signal.SIGTERM) + def test_terminate_already_terminated_child(self): + p = subprocess.Popen([sys.executable, + "-c", "input()"]) + + self.assert_(p.poll() is None, p.poll()) + p.terminate() + self.assertEqual(p.wait(), -signal.SIGTERM) + self.assertRaises(OSError, p.terminate) # # Windows tests # @@ -708,7 +716,7 @@ ' -c "import sys; sys.exit(47)"') self.assertEqual(rc, 47) - def DISABLED_test_send_signal(self): + def test_send_signal(self): p = subprocess.Popen([sys.executable, "-c", "input()"]) @@ -716,7 +724,7 @@ p.send_signal(signal.SIGTERM) self.assertNotEqual(p.wait(), 0) - def DISABLED_test_kill(self): + def test_kill(self): p = subprocess.Popen([sys.executable, "-c", "input()"]) @@ -724,7 +732,7 @@ p.kill() self.assertNotEqual(p.wait(), 0) - def DISABLED_test_terminate(self): + def test_terminate(self): p = subprocess.Popen([sys.executable, "-c", "input()"]) @@ -732,6 +740,15 @@ p.terminate() self.assertNotEqual(p.wait(), 0) + def test_terminate_already_terminated_child(self): + p = subprocess.Popen([sys.executable, + "-c", "input()"]) + + self.assert_(p.poll() is None, p.poll()) + p.terminate() + self.assertEqual(p.wait(), -signal.SIGTERM) + self.assertRaises(OSError, p.terminate) + def test_main(): test_support.run_unittest(ProcessTestCase) if hasattr(test_support, "reap_children"):