Commits

Anonymous committed 1086e3c Merge

Merge

Comments (0)

Files changed (2)

tests/__init__.py

             return False
     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):
     """ 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)
 
 

tests/stdlib/test_socketserver.py

     ('threading', threading))
 
 # only a problem with pyevent
-try:
-    SocketServerTest.test_ForkingUDPServer = lambda *a, **kw: None
-except (NameError, AttributeError):
-    pass
+from eventlet import tests
+if tests.using_pyevent():
+    try:
+        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__":
     test_main()