From 7fc7e45113e72d23ab49ae8900cec4aa49b666c4 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Jul 2018 21:40:00 -0400 Subject: [PATCH] fixed false error raised when scipy not installed --- test/test_path.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test_path.py b/test/test_path.py index e2e823c..ce4d86a 100644 --- a/test/test_path.py +++ b/test/test_path.py @@ -1112,7 +1112,19 @@ class Test_ilength(unittest.TestCase): (apath, 1.0, 87.81018330500885)] for (c, t, s) in tests: - self.assertAlmostEqual(c.ilength(s), t, msg=str((c, t, s))) + try: + self.assertAlmostEqual(c.ilength(s), t, msg=str((c, t, s))) + except: + # These test case values were generated using a system + # with scipy installed -- if scipy is not installed, + # then in cases where `t == 1`, `s` may be slightly + # greater than the length computed previously. + # Thus this try/except block exists as a workaround. + if c.length() < s: + with self.assertRaises(ValueError): + c.ilength(s) + else: + raise # Exceptional Cases def test_ilength_exceptions(self):