[test/server] Only use configcls with statement timeout when needed
Other tests in PostgresFTITC class apparently do not make use of this
particular configuration.
--- 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)')