Disabling pyevent-problematic tests.

This commit is contained in:
Ryan Williams
2010-02-16 20:24:24 -08:00
parent 9675a56211
commit b378280ff0
2 changed files with 12 additions and 7 deletions

View File

@@ -71,11 +71,12 @@ def requires_twisted(func):
return skip_unless(requirement)(func) return skip_unless(requirement)(func)
def using_pyevent(_f):
from eventlet.hubs import get_hub
return 'pyevent' in type(get_hub()).__module__
def skip_with_pyevent(func): def skip_with_pyevent(func):
""" Decorator that skips a test if we're using the pyevent hub.""" """ Decorator that skips a test if we're using the pyevent hub."""
def using_pyevent(_f):
from eventlet.hubs import get_hub
return 'pyevent' in type(get_hub()).__module__
return skip_if(using_pyevent)(func) return skip_if(using_pyevent)(func)

View File

@@ -20,10 +20,14 @@ patcher.inject('test.test_socketserver',
('threading', threading)) ('threading', threading))
# only a problem with pyevent # only a problem with pyevent
try: from eventlet import tests
SocketServerTest.test_ForkingUDPServer = lambda *a, **kw: None if tests.using_pyevent():
except (NameError, AttributeError): try:
pass SocketServerTest.test_ForkingUDPServer = lambda *a, **kw: None
SocketServerTest.test_ForkingTCPServer = lambda *a, **kw: None
SocketServerTest.test_ForkingUnixStreamServer = lambda *a, **kw: None
except (NameError, AttributeError):
pass
if __name__ == "__main__": if __name__ == "__main__":
test_main() test_main()