# HG changeset patch # User Denis Laxalde # Date 1463673463 -7200 # Node ID d9563030a5a187ad424f745d110f47b3750fe0b2 # Parent dede3221342681dd237d8fe675df416aad79e392 [test/server] Only use configcls with statement timeout when needed Other tests in PostgresFTITC class apparently do not make use of this particular configuration. diff -r dede32213426 -r d9563030a5a1 cubicweb/server/test/unittest_postgres.py --- a/cubicweb/server/test/unittest_postgres.py Thu May 19 17:55:26 2016 +0200 +++ b/cubicweb/server/test/unittest_postgres.py Thu May 19 17:57:43 2016 +0200 @@ -50,15 +50,7 @@ class PostgresFTITC(CubicWebTC): - configcls = PostgresTimeoutConfiguration - - @classmethod - def setUpClass(cls): - cls.orig_connect_hooks = lgdb.SQL_CONNECT_HOOKS['postgres'][:] - - @classmethod - def tearDownClass(cls): - lgdb.SQL_CONNECT_HOOKS['postgres'] = cls.orig_connect_hooks + configcls = PostgresApptestConfiguration def test_eid_range(self): # concurrent allocation of eid ranges @@ -155,6 +147,18 @@ {'type-subject-value': u'"nogood"', 'type-subject-choices': u'"todo", "a", "b", "T", "lalala"'}) + +class PostgresStatementTimeoutTC(CubicWebTC): + configcls = PostgresTimeoutConfiguration + + @classmethod + def setUpClass(cls): + cls.orig_connect_hooks = lgdb.SQL_CONNECT_HOOKS['postgres'][:] + + @classmethod + def tearDownClass(cls): + lgdb.SQL_CONNECT_HOOKS['postgres'] = cls.orig_connect_hooks + def test_statement_timeout(self): with self.admin_access.repo_cnx() as cnx: cnx.system_sql('select pg_sleep(0.1)')