[test] Move setup of spa2rql tests into setUpClass method
authorDenis Laxalde <denis.laxalde@logilab.fr>
Mon, 18 Jul 2016 13:59:47 +0200
changeset 11447 ced4de539d66
parent 11446 ca90cd9b112b
child 11448 f79c6894381f
[test] Move setup of spa2rql tests into setUpClass method Thus avoiding cryptic errors upon unittest discovery.
cubicweb/test/unittest_spa2rql.py
--- a/cubicweb/test/unittest_spa2rql.py	Mon Jul 18 20:08:48 2016 +0200
+++ b/cubicweb/test/unittest_spa2rql.py	Mon Jul 18 13:59:47 2016 +0200
@@ -33,15 +33,20 @@
 xy.add_equivalence('Project name', 'doap:Project dc:title')
 
 
-config = TestServerConfiguration('data', __file__)
-config.bootstrap_cubes()
-schema = config.load_schema()
-
 
 @unittest.skipIf(SKIPCAUSE, SKIPCAUSE)
 class XYTC(TestCase):
+
+    schema = None
+
+    @classmethod
+    def setUpClass(cls):
+        config = TestServerConfiguration('data', __file__)
+        config.bootstrap_cubes()
+        cls.schema = config.load_schema()
+
     def setUp(self):
-        self.tr = Sparql2rqlTranslator(schema)
+        self.tr = Sparql2rqlTranslator(self.schema)
 
     def _test(self, sparql, rql, args={}):
         qi = self.tr.translate(sparql)