api_test.py: when testing twistedhub, don't stop the hub since it's supported

This commit is contained in:
Denis Bilenko
2009-06-15 13:13:14 +07:00
parent e2e7d4b661
commit 2ae4edd1f1

View File

@@ -36,10 +36,11 @@ def check_hub():
for nm in 'get_readers', 'get_writers', 'get_excs':
dct = getattr(hub, nm)()
assert not dct, "hub.%s not empty: %s" % (nm, dct)
# Stop the runloop
api.get_hub().abort()
api.sleep(0)
assert not api.get_hub().running
# Stop the runloop (unless it's twistedhub which does not support that)
if not getattr(api.get_hub(), 'uses_twisted_reactor', None):
api.get_hub().abort()
api.sleep(0)
assert not api.get_hub().running
class TestApi(tests.TestCase):