From a7e6f2cdec94fc98c0bb670f545449a9d0a84f58 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 24 Nov 2009 22:08:04 +0000 Subject: Make hooking getSiteManager optional. --- repoze/bfg/testing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'repoze/bfg/testing.py') diff --git a/repoze/bfg/testing.py b/repoze/bfg/testing.py index 4a4acf98b..cfcf82125 100644 --- a/repoze/bfg/testing.py +++ b/repoze/bfg/testing.py @@ -523,13 +523,14 @@ class DummyRequest: self.__dict__.update(kw) def setUp(): - """Set up a fresh BFG testing registry. Use in the ``setUp`` + """ + Set up a fresh BFG testing registry. Use in the ``setUp`` method of unit tests that use the ``register*`` methods in the testing module (e.g. if your unit test uses ``repoze.bfg.testing.registerDummySecurityPolicy``). If you use the ``register*`` functions without calling ``setUp``, unit tests will not be isolated with respect to registrations they perform. - Additionally, the *global* component registry will be used, which + Additionally, a *global* component registry will be used, which may have a different API than is expected by BFG itself. .. note:: This feature is new as of :mod:`repoze.bfg` 1.1. @@ -541,7 +542,7 @@ def setUp(): request.registry = registry manager.push({'registry':registry, 'request':request}) getSiteManager.sethook(get_current_registry) - _clearContext() + _clearContext() # XXX why? def tearDown(): """Tear down a previously set up (via -- cgit v1.2.3