diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-11-11 12:33:24 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-11-11 12:33:24 +0000 |
| commit | 720c8893749556208296af0ee5adcfe9eb373ec7 (patch) | |
| tree | 6f75b271b843d0f46dfccb9b6d6d7ea3c0febc26 /repoze/bfg/testing.py | |
| parent | 6d4015c5d9f5ddeb60d162d385579176a44d8be3 (diff) | |
| download | pyramid-720c8893749556208296af0ee5adcfe9eb373ec7.tar.gz pyramid-720c8893749556208296af0ee5adcfe9eb373ec7.tar.bz2 pyramid-720c8893749556208296af0ee5adcfe9eb373ec7.zip | |
- Allow ``testing.registerEventListener`` to be used with Zope 3
style "object events" (subscribers accept more than a single event
argument). We extend the list with the arguments, rather than
append.
Prep for 0.4.7.
Diffstat (limited to 'repoze/bfg/testing.py')
| -rw-r--r-- | repoze/bfg/testing.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/repoze/bfg/testing.py b/repoze/bfg/testing.py index 26690c48d..a7fc12827 100644 --- a/repoze/bfg/testing.py +++ b/repoze/bfg/testing.py @@ -44,10 +44,11 @@ def registerEventListener(event_iface=Interface): matches ``event_iface``, that event will be appended to the list. You can then compare the values in the list to expected event notifications. This method is useful when testing code that wants - to call ``zope.component.event.dispatch``.""" + to call ``zope.component.event.dispatch`` or + ``zope.component.event.objectEventNotify``.""" L = [] - def subscriber(event): - L.append(event) + def subscriber(*event): + L.extend(event) registerSubscriber(subscriber, event_iface) return L |
