devtools/testlib.py
branchstable
changeset 5128 e5d300d75519
parent 5102 04c84959cd85
child 5159 2543cfa5d54a
child 5175 6efb7a7ae570
--- a/devtools/testlib.py	Thu Apr 01 08:24:11 2010 +0200
+++ b/devtools/testlib.py	Thu Apr 01 08:24:53 2010 +0200
@@ -360,9 +360,11 @@
         self.vreg._loadedmods.setdefault(self.__module__, {})
         for obj in appobjects:
             self.vreg.register(obj)
-        yield
-        for obj in appobjects:
-            self.vreg.unregister(obj)
+        try:
+            yield
+        finally:
+            for obj in appobjects:
+                self.vreg.unregister(obj)
 
     # vregistry inspection utilities ###########################################