From e2e7d4b661db23477cc83d6f53d90197bf1753a0 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 15 Jun 2009 13:12:40 +0700 Subject: [PATCH] api_test.py: don't include test_explicit in twistedhub tests, since it's not supported there --- greentest/api_test.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/greentest/api_test.py b/greentest/api_test.py index f97fdd4..1c472ff 100644 --- a/greentest/api_test.py +++ b/greentest/api_test.py @@ -162,13 +162,15 @@ class TestApi(tests.TestCase): check_hub() - def test_explicit_hub(self): - api.use_hub(Foo) - assert isinstance(api.get_hub(), Foo), api.get_hub() - - api.use_hub(api.get_default_hub()) - - check_hub() + if not getattr(api.get_hub(), 'uses_twisted_reactor', None): + def test_explicit_hub(self): + oldhub = api.get_hub() + try: + api.use_hub(Foo) + assert isinstance(api.get_hub(), Foo), api.get_hub() + finally: + api._threadlocal.hub = oldhub + check_hub() def test_named(self): named_foo = api.named('api_test.Foo')