--- 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()