summaryrefslogtreecommitdiff
path: root/src/zope/component/testing.py
diff options
context:
space:
mode:
authorMichael Howitz <mh@gocept.com>2023-04-14 08:03:36 +0200
committerGitHub <noreply@github.com>2023-04-14 08:03:36 +0200
commit1c6af940c08ca2fdb142916974a192ab6ff9ea7c (patch)
tree924adcafcaf497f1fa5f4c2f506ff6085caa3ae6 /src/zope/component/testing.py
parentba0550c4645c3e73f32f7cd77bbe3cc528f76ad6 (diff)
downloadzope-component-1c6af940c08ca2fdb142916974a192ab6ff9ea7c.tar.gz
Config with pure python template (#71)
* Lint the code, improve coverage. * Bumped version for breaking release. * Drop support for Python 2.7, 3.5, 3.6.
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()