summaryrefslogtreecommitdiff
path: root/tests/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index f7c1d59..7732f8c 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -110,6 +110,17 @@ def skip_if_no_itimer(func):
return skip_unless(has_itimer)(func)
+def skip_if_no_ssl(func):
+ """ Decorator that skips a test if SSL is not available."""
+ try:
+ import eventlet.green.ssl
+ except ImportError:
+ try:
+ import eventlet.green.OpenSSL
+ except ImportError:
+ skipped(func)
+
+
class TestIsTakingTooLong(Exception):
""" Custom exception class to be raised when a test's runtime exceeds a limit. """
pass