devtools/apptest.py
changeset 2293 7ded2a1416e4
parent 2234 1fbcf202882d
parent 2252 dd9758cb77e1
child 2298 8dffb4cce3b7
--- a/devtools/apptest.py	Thu Jul 02 10:36:25 2009 +0200
+++ b/devtools/apptest.py	Mon Jul 06 19:55:18 2009 +0200
@@ -462,14 +462,13 @@
         self.__close = repo.close
         self.cnxid = self.cnx.sessionid
         self.session = repo._sessions[self.cnxid]
-        # XXX copy schema since hooks may alter it and it may be not fully
-        #     cleaned (missing some schema synchronization support)
-        try:
-            origschema = repo.__schema
-        except AttributeError:
-            origschema = repo.schema
-            repo.__schema = origschema
         if self.copy_schema:
+            # XXX copy schema since hooks may alter it and it may be not fully
+            #     cleaned (missing some schema synchronization support)
+            try:
+                origschema = repo.__schema
+            except AttributeError:
+                repo.__schema = origschema = repo.schema
             repo.schema = deepcopy(origschema)
             repo.set_schema(repo.schema) # reset hooks
             repo.vreg.update_schema(repo.schema)