# HG changeset patch # User Denis Laxalde # Date 1463673326 -7200 # Node ID dede3221342681dd237d8fe675df416aad79e392 # Parent 0d9105673ec902b24a0cf135ded123ed26bed17e [server/test] Add an assertion in test_statement_timeout diff -r 0d9105673ec9 -r dede32213426 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()