From 8c559261d288cfa297f0c4eb398155935c38447d Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Mon, 11 Feb 2013 17:20:48 +0100
Subject: [PATCH] runUnitTest: close ZODB connection that was open to
 initialize test runner

This speeds up a bit, but not having to keep synchronized a connection that is
never used.
---
 product/ERP5Type/tests/runUnitTest.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py
index 19ff5f2fdd..4b8cf585a3 100644
--- a/product/ERP5Type/tests/runUnitTest.py
+++ b/product/ERP5Type/tests/runUnitTest.py
@@ -394,7 +394,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
   else:
     products_home = os.path.join(instance_home, 'Products')
 
-  from Testing.ZopeTestCase import layer, PortalTestCase
+  from Testing.ZopeTestCase import layer, PortalTestCase, ZopeLite
   _apply_patches = layer._deferred_setup.pop(0)[0]
   assert _apply_patches.__name__ == '_apply_patches'
 
@@ -469,6 +469,8 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
   def assertFalse():
     assert False
   layer.onsetup = assertFalse
+  ZopeLite._theApp._p_jar.close()
+  ZopeLite._theApp = None
 
   from Products.ERP5Type.tests.utils import DbFactory
   root_db_name, = cfg.dbtab.databases.keys()
-- 
2.30.9