devtools/apptest.py
branchstable
changeset 2252 dd9758cb77e1
parent 2221 d9b85a7b0bdd
child 2293 7ded2a1416e4
--- a/devtools/apptest.py	Fri Jul 03 10:26:19 2009 +0200
+++ b/devtools/apptest.py	Fri Jul 03 10:27:03 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)