[test] Skip spa2rql tests when fyzz is not available
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 11 Jun 2015 09:51:30 +0200
changeset 10452 f3dec653a27d
parent 10451 cffe653f93a9
child 10453 76f601a90aa7
[test] Skip spa2rql tests when fyzz is not available Closes #5456750.
test/unittest_spa2rql.py
--- a/test/unittest_spa2rql.py	Tue Jun 23 18:10:45 2015 +0200
+++ b/test/unittest_spa2rql.py	Thu Jun 11 09:51:30 2015 +0200
@@ -15,10 +15,17 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
+import unittest
+
 from logilab.common.testlib import TestCase, unittest_main
 from cubicweb.devtools import TestServerConfiguration
 from cubicweb.xy import xy
-from cubicweb.spa2rql import Sparql2rqlTranslator
+
+SKIPCAUSE = None
+try:
+    from cubicweb.spa2rql import Sparql2rqlTranslator
+except ImportError as exc:
+    SKIPCAUSE = str(exc)
 
 xy.add_equivalence('Project', 'doap:Project')
 xy.add_equivalence('Project creation_date', 'doap:Project doap:created')
@@ -31,6 +38,7 @@
 schema = config.load_schema()
 
 
+@unittest.skipIf(SKIPCAUSE, SKIPCAUSE)
 class XYTC(TestCase):
     def setUp(self):
         self.tr = Sparql2rqlTranslator(schema)