diff options
Diffstat (limited to 'src/zope/component/testing.py')
-rw-r--r-- | src/zope/component/testing.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/zope/component/testing.py b/src/zope/component/testing.py index d49f1cb..d04c4ce 100644 --- a/src/zope/component/testing.py +++ b/src/zope/component/testing.py @@ -18,17 +18,17 @@ import zope.component.event # we really don't need special setup now: +class _PlacelessSetupFallback(object): + def cleanUp(self): + from zope.component.globalregistry import base + base.__init__('base') + + setUp = tearDown = cleanUp + try: from zope.testing.cleanup import CleanUp as PlacelessSetup -except ImportError: - class PlacelessSetup(object): - def cleanUp(self): - from zope.component.globalregistry import base - base.__init__('base') - def setUp(self): - self.cleanUp() - def tearDown(self): - self.cleanUp() +except ImportError: # pragma: no cover + PlacelessSetup = _PlacelessSetupFallback def setUp(test=None): PlacelessSetup().setUp() |