Commit d030fd34 authored by Denis Bilenko's avatar Denis Bilenko

fix test__select.py to pass on windows and on py3.2 (the latter is untested)

parent 511d46d7
import sys import sys
from gevent import select from gevent import select, socket
import greentest import greentest
...@@ -9,26 +9,28 @@ class TestSelect(greentest.GenericWaitTestCase): ...@@ -9,26 +9,28 @@ class TestSelect(greentest.GenericWaitTestCase):
select.select([], [], [], timeout) select.select([], [], [], timeout)
class TestSelectTypes(greentest.TestCase): if sys.platform != 'win32':
if sys.platform == 'win32': class TestSelectRead(greentest.GenericWaitTestCase):
def test_int(self): def wait(self, timeout):
import msvcrt select.select([sys.stdin.fileno()], [], [], timeout)
self.assertRaises(select.error, select.select, [msvcrt.get_osfhandle(1)], [], [], 0.001)
self.assertRaises(select.error, select.select, [int(msvcrt.get_osfhandle(1))], [], [], 0.001)
def test_long(self):
import msvcrt
self.assertRaises(IOError, select.select, [long(msvcrt.get_osfhandle(1))], [], [], 0.001)
else: class TestSelectTypes(greentest.TestCase):
def test_int(self): def test_int(self):
select.select([1], [], [], 0.001) sock = socket.socket()
select.select([int(sock.fileno())], [], [], 0.001)
try:
long
except NameError:
pass
else:
def test_long(self): def test_long(self):
select.select([1L], [], [], 0.001) sock = socket.socket()
select.select([long(sock.fileno())], [], [], 0.001)
def test_string(self): def test_string(self):
self.switch_expected = False self.switch_expected = False
......
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