[pypy-svn] r32138 - pypy/dist/pypy/lib/pyontology/test

ale at codespeak.net ale at codespeak.net
Mon Sep 11 10:38:52 CEST 2006


Author: ale
Date: Mon Sep 11 10:38:50 2006
New Revision: 32138

Modified:
   pypy/dist/pypy/lib/pyontology/test/test_sparql.py
Log:
Skip the test if pyparsing is not installed

Modified: pypy/dist/pypy/lib/pyontology/test/test_sparql.py
==============================================================================
--- pypy/dist/pypy/lib/pyontology/test/test_sparql.py	(original)
+++ pypy/dist/pypy/lib/pyontology/test/test_sparql.py	Mon Sep 11 10:38:50 2006
@@ -1,8 +1,14 @@
-from pypy.lib.pyontology.sparql_grammar import SPARQLGrammar as SP
+try:
+    import pyparsing
+except ImportError:
+    from py.test import skip
+    skip("Pyparsing not installed")
 
+from pypy.lib.pyontology.sparql_grammar import SPARQLGrammar as SP
 
 qt = """
-         PREFIX ns : <http://example.org/ns#>
+         PREFIX ns: <http://example.org/ns#>
+
          SELECT ?x ?y
          WHERE {
                  ?x ns:p 123 .
@@ -15,7 +21,6 @@
     query = SP.Query.parseString(qt)[0]
     assert query.PrefixDecl[0].ns == 'http://example.org/ns#'
     where = query.SelectQuery[0].WhereClause[0]
-
     assert len(where) == 1
     triples = where.GroupGraphPattern[0].Triples
     assert len(triples) == 2



More information about the Pypy-commit mailing list