summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zope/component/hookable.py19
-rw-r--r--src/zope/component/interfaces.py28
-rw-r--r--src/zope/component/registry.py16
-rw-r--r--src/zope/component/tests/test_interfaces.py40
-rw-r--r--src/zope/component/tests/test_registry.py27
5 files changed, 10 insertions, 120 deletions
diff --git a/src/zope/component/hookable.py b/src/zope/component/hookable.py
deleted file mode 100644
index 275c4b6..0000000
--- a/src/zope/component/hookable.py
+++ /dev/null
@@ -1,19 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2009 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-This module is deprecated. Prefer to use zope.hookable.hookable.
-"""
-# pragma: no cover
-import zope.deprecation
-zope.deprecation.moved("zope.hookable", "4.5")
diff --git a/src/zope/component/interfaces.py b/src/zope/component/interfaces.py
index 15fbb55..068c625 100644
--- a/src/zope/component/interfaces.py
+++ b/src/zope/component/interfaces.py
@@ -20,33 +20,7 @@ are provided by `zope.component` directly.
from zope.interface import Attribute
from zope.interface import Interface
-
-# BBB 2011-09-09, import interfaces from zope.interface
-import zope.deferredimport
-zope.deferredimport.deprecatedFrom(
- "Import from zope.interface.interfaces",
- "zope.interface.interfaces",
- 'ComponentLookupError',
- 'Invalid',
- 'IObjectEvent',
- 'ObjectEvent',
- 'IComponentLookup',
- 'IRegistration',
- 'IUtilityRegistration',
- '_IBaseAdapterRegistration',
- 'IAdapterRegistration',
- 'ISubscriptionAdapterRegistration',
- 'IHandlerRegistration',
- 'IRegistrationEvent',
- 'RegistrationEvent',
- 'IRegistered',
- 'Registered',
- 'IUnregistered',
- 'Unregistered',
- 'IComponentRegistry',
- 'IComponents',
-)
-
+# pylint:disable=inherit-non-class,no-self-argument,no-method-argument
class IComponentArchitecture(Interface):
"""The Component Architecture is defined by two key components: Adapters
diff --git a/src/zope/component/registry.py b/src/zope/component/registry.py
index 6c0c47c..2eb3d6b 100644
--- a/src/zope/component/registry.py
+++ b/src/zope/component/registry.py
@@ -23,22 +23,6 @@ from zope.interface.interfaces import IRegistrationEvent
from zope.interface.interfaces import ISubscriptionAdapterRegistration
from zope.interface.interfaces import IUtilityRegistration
-# BBB, import component-related from zope.interface
-import zope.deferredimport
-zope.deferredimport.deprecatedFrom(
- "Import from zope.interface.registry",
- "zope.interface.registry",
- 'Components',
- '_getUtilityProvided',
- '_getAdapterProvided',
- '_getAdapterRequired',
- 'UtilityRegistration',
- 'AdapterRegistration',
- 'SubscriptionRegistration',
- 'HandlerRegistration',
-)
-
-
@adapter(IUtilityRegistration, IRegistrationEvent)
def dispatchUtilityRegistrationEvent(registration, event):
handle(registration.component, event)
diff --git a/src/zope/component/tests/test_interfaces.py b/src/zope/component/tests/test_interfaces.py
index 353a212..4d1794d 100644
--- a/src/zope/component/tests/test_interfaces.py
+++ b/src/zope/component/tests/test_interfaces.py
@@ -17,37 +17,13 @@ Tests for zope.component.interfaces
import unittest
-class TestBackwardsCompat(unittest.TestCase):
+class TestInterfaces(unittest.TestCase):
- def test_interface_warnings(self):
- from zope.component import interfaces
- import warnings
- for name in (
- 'ComponentLookupError',
- 'Invalid',
- 'IObjectEvent',
- 'ObjectEvent',
- 'IComponentLookup',
- 'IRegistration',
- 'IUtilityRegistration',
- '_IBaseAdapterRegistration',
- 'IAdapterRegistration',
- 'ISubscriptionAdapterRegistration',
- 'IHandlerRegistration',
- 'IRegistrationEvent',
- 'RegistrationEvent',
- 'IRegistered',
- 'Registered',
- 'IUnregistered',
- 'Unregistered',
- 'IComponentRegistry',
- 'IComponents',
- ):
- with warnings.catch_warnings(record=True) as log:
- warnings.simplefilter("always")
- getattr(interfaces, name)
+ def test_nothing(self):
+ """
+ This exists only so that zope.testrunner doesn't complain this
+ module has no tests.
- self.assertEqual(1, len(log), name)
- message = str(log[0].message)
- self.assertIn(name, message)
- self.assertIn("Import from zope.interface.interfaces", message)
+ Even though this file is empty, we want to keep it around for ease
+ of browsing the history.
+ """
diff --git a/src/zope/component/tests/test_registry.py b/src/zope/component/tests/test_registry.py
index 39f9f3c..1d02f86 100644
--- a/src/zope/component/tests/test_registry.py
+++ b/src/zope/component/tests/test_registry.py
@@ -105,36 +105,11 @@ class Test_dispatchHandlerRegistrationEvent(unittest.TestCase):
self.assertEqual(_handled, [(_registration.handler, _EVENT)])
-class TestBackwardsCompat(unittest.TestCase):
-
- def test_interface_warnings(self):
- from zope.component import registry
- import warnings
- for name in (
- 'Components',
- '_getUtilityProvided',
- '_getAdapterProvided',
- '_getAdapterRequired',
- 'UtilityRegistration',
- 'AdapterRegistration',
- 'SubscriptionRegistration',
- 'HandlerRegistration',
- ):
- with warnings.catch_warnings(record=True) as log:
- warnings.simplefilter("always")
- getattr(registry, name)
-
- self.assertEqual(1, len(log), name)
- message = str(log[0].message)
- self.assertIn(name, message)
- self.assertIn("Import from zope.interface.registry", message)
-
-
class _Monkey(object):
# context-manager for replacing module names in the scope of a test.
def __init__(self, module, **kw):
self.module = module
- self.to_restore = dict([(key, getattr(module, key)) for key in kw])
+ self.to_restore = {key: getattr(module, key) for key in kw}
for key, value in kw.items():
setattr(module, key, value)