Fixed test_trampoline_timeout.

This commit is contained in:
rdw
2008-03-19 15:57:50 -05:00
parent f6c483566b
commit 4a2459b6bb
2 changed files with 3 additions and 6 deletions

View File

@@ -136,8 +136,8 @@ def trampoline(fd, read=None, write=None, timeout=None):
def _do_close(fn):
hub.remove_descriptor(fn)
greenlib.switch(self, exc=socket.error(32, 'Broken pipe'))
def _do_timeout(fn):
hub.remove_descriptor(fn)
def _do_timeout():
hub.remove_descriptor(fileno)
greenlib.switch(self, exc=TimeoutError())
def cb(_fileno):
if t is not None:

View File

@@ -93,10 +93,7 @@ class TestApi(tests.TestCase):
check_hub()
def dont_test_trampoline_timeout(self):
"""This test is broken. Please change it's name to test_trampoline_timeout,
and fix the bug (or fix the test)
"""
def test_trampoline_timeout(self):
server = api.tcp_listener(('0.0.0.0', 0))
bound_port = server.getsockname()[1]