Commit 47126b88 authored by Ralf Schmitt's avatar Ralf Schmitt

create a pipe instead of select'ing on sys.stdin in test__select.py

this makes test__select.py compatible with py.test and makes it
possible to run test__select.py with stdin redirected.
parent 605ca0be
import sys
import os
from gevent import select, socket
import greentest
......@@ -14,7 +15,12 @@ if sys.platform != 'win32':
class TestSelectRead(greentest.GenericWaitTestCase):
def wait(self, timeout):
select.select([sys.stdin.fileno()], [], [], timeout)
r, w = os.pipe()
try:
select.select([r], [], [], timeout)
finally:
os.close(r)
os.close(w)
class TestSelectTypes(greentest.TestCase):
......
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