[server/test] Add an assertion in test_statement_timeout
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 19 May 2016 17:55:26 +0200
changeset 11257 dede32213426
parent 11256 0d9105673ec9
child 11258 d9563030a5a1
[server/test] Add an assertion in test_statement_timeout
cubicweb/server/test/unittest_postgres.py
--- a/cubicweb/server/test/unittest_postgres.py	Wed Jul 01 08:58:39 2015 +0200
+++ b/cubicweb/server/test/unittest_postgres.py	Thu May 19 17:55:26 2016 +0200
@@ -158,8 +158,9 @@
     def test_statement_timeout(self):
         with self.admin_access.repo_cnx() as cnx:
             cnx.system_sql('select pg_sleep(0.1)')
-            with self.assertRaises(Exception):
+            with self.assertRaises(Exception) as cm:
                 cnx.system_sql('select pg_sleep(0.3)')
+        self.assertIn('statement timeout', str(cm.exception))
 
 
 class PostgresLimitSizeTC(CubicWebTC):
@@ -182,5 +183,5 @@
 
 
 if __name__ == '__main__':
-    from logilab.common.testlib import unittest_main
-    unittest_main()
+    import unittest
+    unittest.main()