[test] don't try to reset session manager during test, stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Mar 2010 15:40:57 +0100
branchstable
changeset 5000 f1a10b41417a
parent 4999 221f76e14eea
child 5001 4f6a1295a8d2
[test] don't try to reset session manager during test, this leads to weird failures when running multiple tests
web/application.py
--- a/web/application.py	Wed Mar 24 15:22:01 2010 +0100
+++ b/web/application.py	Wed Mar 24 15:40:57 2010 +0100
@@ -123,7 +123,11 @@
         SESSION_MANAGER = self.session_manager
         if not 'last_login_time' in self.vreg.schema:
             self._update_last_login_time = lambda x: None
-        CW_EVENT_MANAGER.bind('after-registry-reload', self.reset_session_manager)
+        if self.vreg.config.mode != 'test':
+            # don't try to reset session manager during test, this leads to
+            # weird failures when running multiple tests
+            CW_EVENT_MANAGER.bind('after-registry-reload',
+                                  self.reset_session_manager)
 
     def reset_session_manager(self):
         data = self.session_manager.dump_data()