[test] don't clear rtags during tests, may cause breakage with manually import appobjects modules (see unittest_tracker for instance) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Mar 2010 15:09:21 +0100
branchstable
changeset 4996 45ce27d538a1
parent 4995 1817b87c7f67
child 4997 aed7bdb9da54
[test] don't clear rtags during tests, may cause breakage with manually import appobjects modules (see unittest_tracker for instance)
cwvreg.py
--- a/cwvreg.py	Wed Mar 24 15:08:24 2010 +0100
+++ b/cwvreg.py	Wed Mar 24 15:09:21 2010 +0100
@@ -22,12 +22,6 @@
 from cubicweb.rtags import RTAGS
 
 
-@onevent('before-registry-reload')
-def clear_rtag_objects():
-    for rtag in RTAGS:
-        rtag.clear()
-
-
 def use_interfaces(obj):
     """return interfaces used by the given object by searching for implements
     selectors, with a bw compat fallback to accepts_interfaces attribute
@@ -265,6 +259,13 @@
         self.schema = None
         self.initialized = False
         self.reset()
+        if self.config.mode != 'test':
+            # don't clear rtags during test, this may cause breakage with
+            # manually imported appobject modules
+            @onevent('before-registry-reload')
+            def clear_rtag_objects():
+                for rtag in RTAGS:
+                    rtag.clear()
 
     def setdefault(self, regid):
         try: