From 7ac5aa82a7e67cd82744976315b93a9d660f9ad3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 28 Nov 2009 19:27:47 +0000 Subject: Deal with registries we may not understand. --- repoze/bfg/testing.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'repoze/bfg/testing.py') diff --git a/repoze/bfg/testing.py b/repoze/bfg/testing.py index 1859cf9b8..9cba616a7 100644 --- a/repoze/bfg/testing.py +++ b/repoze/bfg/testing.py @@ -531,7 +531,7 @@ def setUp(registry=None, request=None, hook_zca=True): .. note:: The ``setUp`` function is new as of :mod:`repoze.bfg` 1.1. - Use this function in the ``setUp`` method of a unit test test case + Use this function in the ``setUp`` method of a unittest test case which directly or indirectly uses: - any of the ``register*`` functions in ``repoze.bfg.testing`` @@ -621,7 +621,11 @@ def tearDown(unhook_zca=True): if info is not None: reg = info['registry'] if hasattr(reg, '__init__') and hasattr(reg, '__name__'): - reg.__init__(reg.__name__) + try: + reg.__init__(reg.__name__) + except TypeError: + # maybe somebody's using a registry we don't understand + pass _clearContext() # XXX why? def cleanUp(*arg, **kw): -- cgit v1.2.3