tests: skip_if_no_ssl decorator always returned None

This commit is contained in:
Sergey Shepelev
2013-01-10 16:06:31 +04:00
parent d4565ee6a0
commit b0b82a2f8a

View File

@@ -1,12 +1,12 @@
# package is named tests, not test, so it won't be confused with test in stdlib # package is named tests, not test, so it won't be confused with test in stdlib
import sys
import os
import errno import errno
import os
import unittest import unittest
import warnings import warnings
from eventlet import debug, hubs from eventlet import debug, hubs
# convenience for importers # convenience for importers
main = unittest.main main = unittest.main
@@ -114,11 +114,13 @@ def skip_if_no_ssl(func):
""" Decorator that skips a test if SSL is not available.""" """ Decorator that skips a test if SSL is not available."""
try: try:
import eventlet.green.ssl import eventlet.green.ssl
return func
except ImportError: except ImportError:
try: try:
import eventlet.green.OpenSSL import eventlet.green.OpenSSL
return func
except ImportError: except ImportError:
skipped(func) return skipped(func)
class TestIsTakingTooLong(Exception): class TestIsTakingTooLong(Exception):