[test] Move setup of spa2rql tests into setUpClass method
Thus avoiding cryptic errors upon unittest discovery.
--- 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)