summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Fulton <jim@zope.com>2015-10-17 11:11:54 -0400
committerJim Fulton <jim@zope.com>2015-10-17 11:11:54 -0400
commitcfc5a87890fb5886976c6ce640a0f4840a91b9c6 (patch)
treeddbb5edd275b4348ae47b00a5f0316e79eb3ba44
parent2d56e36f354fd69b47e90f1b8367d206aba5273e (diff)
downloadzope-event-cfc5a87890fb5886976c6ce640a0f4840a91b9c6.tar.gz
Added a simple class-based handler implementation.
-rw-r--r--CHANGES.rst4
-rw-r--r--docs/index.rst1
-rw-r--r--src/zope/event/tests.py12
3 files changed, 15 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index ebb773e..81120c5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,11 +1,11 @@
``zope.event`` Changelog
========================
-4.0.4 (unreleased)
+4.1.0 (unreleased)
------------------
- Require 100% branch (as well as statement) coverage.
-
+- Added a simple class-based handler implementation.
4.0.3 (2014-03-19)
------------------
diff --git a/docs/index.rst b/docs/index.rst
index 6fd6e4b..0d5be8b 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -19,6 +19,7 @@ Contents:
usage
theory
api
+ classhandler
hacking
Indices and tables
diff --git a/src/zope/event/tests.py b/src/zope/event/tests.py
index a7b045d..eed5562 100644
--- a/src/zope/event/tests.py
+++ b/src/zope/event/tests.py
@@ -13,6 +13,7 @@
##############################################################################
""" Test the event system
"""
+import doctest
import unittest
class Test_notify(unittest.TestCase):
@@ -42,7 +43,18 @@ class Test_notify(unittest.TestCase):
self._callFUT(event)
self.assertEqual(dummy, [event])
+def setUpClassHandlers(test):
+ import zope.event
+ test.globs['old_subs'] = zope.event.subscribers
+
+def tearDownClassHandlers(test):
+ import zope.event
+ zope.event.subscribers = test.globs['old_subs']
+
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(Test_notify),
+ doctest.DocTestSuite(
+ 'zope.event.classhandler',
+ setUp=setUpClassHandlers, tearDown=tearDownClassHandlers)
))