From 2ae4edd1f1d7a1891343c9ae0b7737b5712d5a5d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 15 Jun 2009 13:13:14 +0700 Subject: [PATCH] api_test.py: when testing twistedhub, don't stop the hub since it's supported --- greentest/api_test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/greentest/api_test.py b/greentest/api_test.py index 1c472ff..442fa69 100644 --- a/greentest/api_test.py +++ b/greentest/api_test.py @@ -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):