Commit c3654467 authored by Denis Bilenko's avatar Denis Bilenko

test__subprocess.py: make it work on Windows

parent d45e794b
...@@ -4,6 +4,7 @@ import os ...@@ -4,6 +4,7 @@ import os
import errno import errno
import greentest import greentest
from gevent import subprocess from gevent import subprocess
import time
if subprocess.mswindows: if subprocess.mswindows:
...@@ -111,12 +112,13 @@ class Test(greentest.TestCase): ...@@ -111,12 +112,13 @@ class Test(greentest.TestCase):
# see issue #134 # see issue #134
r, w = os.pipe() r, w = os.pipe()
p = subprocess.Popen(['grep', 'text'], stdin=subprocess.FileObject(r)) p = subprocess.Popen(['grep', 'text'], stdin=subprocess.FileObject(r))
os.close(w)
try: try:
self.assertEqual(p.wait(timeout=0.1), None) os.close(w)
time.sleep(0.1)
self.assertEqual(p.poll(), None)
finally: finally:
if p.poll() is None: if p.poll() is None:
p.send_signal(9) p.kill()
def test_issue148(self): def test_issue148(self):
for i in range(7): for i in range(7):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment