summaryrefslogtreecommitdiff
path: root/tests/__init__.py
diff options
context:
space:
mode:
authorRyan Williams <rdw@lindenlab.com>2009-12-17 10:37:59 -0800
committerRyan Williams <rdw@lindenlab.com>2009-12-17 10:37:59 -0800
commit441f72f4081c8a3ede26d0fc06d6c2ca2eff81fd (patch)
treedd00600b0651fb231c1dadf8d568c9bd008e4e7e /tests/__init__.py
parentc7d3432b298f3e05e6775ffd999418006be14d77 (diff)
downloadeventlet-441f72f4081c8a3ede26d0fc06d6c2ca2eff81fd.tar.gz
Moved get_hub, use_hub, get_default_hub to eventlet.hubs. This is a step in the direction of better factoring and fewer circular-ish dependencies.
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index 617e179..d99f0fa 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -4,7 +4,7 @@ import os
import errno
import unittest
-# convenience
+# convenience for importers
main = unittest.main
def skipped(func):
@@ -63,7 +63,7 @@ def skip_unless(condition):
def requires_twisted(func):
""" Decorator that skips a test if Twisted is not present."""
def requirement(_f):
- from eventlet.api import get_hub
+ from eventlet.hubs import get_hub
try:
return 'Twisted' in type(get_hub()).__name__
except Exception:
@@ -74,12 +74,13 @@ def requires_twisted(func):
def skip_with_pyevent(func):
""" Decorator that skips a test if we're using the pyevent hub."""
def using_pyevent(_f):
- from eventlet.api import get_hub
+ from eventlet.hubs import get_hub
return 'pyevent' in type(get_hub()).__module__
return skip_if(using_pyevent)(func)
def skip_on_windows(func):
+ """ Decorator that skips a test on Windows."""
import sys
return skip_if(sys.platform.startswith('win'))(func)
@@ -109,14 +110,14 @@ class SilencedTestCase(LimitedTestCase):
""" Subclass of LimitedTestCase that also silences the printing of timer
exceptions."""
def setUp(self):
- from eventlet import api
+ from eventlet import hubs
super(SilencedTestCase, self).setUp()
- api.get_hub().silent_timer_exceptions = True
+ hubs.get_hub().silent_timer_exceptions = True
def tearDown(self):
- from eventlet import api
+ from eventlet import hubs
super(SilencedTestCase, self).tearDown()
- api.get_hub().silent_timer_exceptions = False
+ hubs.get_hub().silent_timer_exceptions = False
def find_command(command):