From 7063e1109756eb1b662c29324c9bc2646e1122f7 Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Thu, 7 Sep 2017 22:01:11 +0200
Subject: [PATCH] Fix tests for If -> Piecewise

---
 pymbolic/interop/sympy.py | 2 +-
 test/test_sympy.py        | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/pymbolic/interop/sympy.py b/pymbolic/interop/sympy.py
index c5e1e05..2ccb9fe 100644
--- a/pymbolic/interop/sympy.py
+++ b/pymbolic/interop/sympy.py
@@ -125,7 +125,7 @@ class PymbolicToSympyMapper(PymbolicToSympyLikeMapper):
         elif expr.operator == ">=":
             return self.sym.GreaterThan(left, right)
         else:
-            raise NotImplementedError("Cannot understand operator {}".format(expr.operator))
+            raise NotImplementedError("Unknown operator '%s'" % expr.operator)
 
 # }}}
 
diff --git a/test/test_sympy.py b/test/test_sympy.py
index e5a00a8..e0429bb 100644
--- a/test/test_sympy.py
+++ b/test/test_sympy.py
@@ -115,6 +115,7 @@ def test_pymbolic_to_sympy():
 
 
 def test_sympy_if_condition():
+    pytest.importorskip("sympy")
     from pymbolic.interop.sympy import PymbolicToSympyMapper, SympyToPymbolicMapper
     forward = PymbolicToSympyMapper()
     backward = SympyToPymbolicMapper()
-- 
GitLab