summaryrefslogtreecommitdiff
path: root/src/zope/component/testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/component/testing.py')
-rw-r--r--src/zope/component/testing.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/zope/component/testing.py b/src/zope/component/testing.py
index d04c4ce..f210b52 100644
--- a/src/zope/component/testing.py
+++ b/src/zope/component/testing.py
@@ -15,23 +15,27 @@
"""
# HACK to make sure basicmost event subscriber is installed
-import zope.component.event
+import zope.component.event # noqa: F401 imported but unused
+
# we really don't need special setup now:
-class _PlacelessSetupFallback(object):
+class _PlacelessSetupFallback:
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: # pragma: no cover
+except ImportError: # pragma: no cover
PlacelessSetup = _PlacelessSetupFallback
+
def setUp(test=None):
PlacelessSetup().setUp()
+
def tearDown(test=None):
PlacelessSetup().tearDown()