[test/server] Only use configcls with statement timeout when needed
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 19 May 2016 17:57:43 +0200
changeset 11258 d9563030a5a1
parent 11257 dede32213426
child 11259 84e2a1121f4b
[test/server] Only use configcls with statement timeout when needed Other tests in PostgresFTITC class apparently do not make use of this particular configuration.
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)')