server/test/unittest_repository.py
changeset 8999 81a5d57d9230
parent 8947 3bbd416b09ec
child 9008 e0aa7cf8abf8
--- a/server/test/unittest_repository.py	Thu Jun 06 12:29:44 2013 +0200
+++ b/server/test/unittest_repository.py	Mon May 27 15:48:03 2013 +0200
@@ -44,6 +44,7 @@
 from cubicweb.server.sqlutils import SQL_PREFIX
 from cubicweb.server.hook import Hook
 from cubicweb.server.sources import native
+from cubicweb.server.session import SessionClosedError
 
 
 class RepositoryTC(CubicWebTC):
@@ -262,7 +263,7 @@
             repo.execute(cnxid, 'DELETE CWUser X WHERE X login "toto"')
             repo.commit(cnxid)
         try:
-            with self.assertRaises(Exception) as cm:
+            with self.assertRaises(SessionClosedError) as cm:
                 run_transaction()
             self.assertEqual(str(cm.exception), 'try to access connections set on a closed session %s' % cnxid)
         finally: