# HG changeset patch # User Sylvain Thénault # Date 1270038739 -7200 # Node ID 55b8b7a5bc4a968262eb85477b85b59816ab1e65 # Parent f8cbdb51e6d4a5da127bfc5d1c455d3103e7338e# Parent 5cf83b9356d5bb84e9fbed78a3b59363a86176f1 merge diff -r f8cbdb51e6d4 -r 55b8b7a5bc4a server/test/unittest_storage.py --- a/server/test/unittest_storage.py Wed Mar 31 14:32:07 2010 +0200 +++ b/server/test/unittest_storage.py Wed Mar 31 14:32:19 2010 +0200 @@ -6,6 +6,8 @@ :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses """ +from __future__ import with_statement + from logilab.common.testlib import unittest_main from cubicweb.devtools.testlib import CubicWebTC @@ -93,14 +95,8 @@ self.assertEquals(fspath.getvalue(), '/the/path') def test_source_storage_transparency(self): - self.vreg._loadedmods[__name__] = {} - self.vreg.register(DummyBeforeHook) - self.vreg.register(DummyAfterHook) - try: + with self.temporary_appobjects(DummyBeforeHook, DummyAfterHook): self.create_file() - finally: - self.vreg.unregister(DummyBeforeHook) - self.vreg.unregister(DummyAfterHook) def test_source_mapped_attribute_error_cases(self): ex = self.assertRaises(QueryError, self.execute,