From 04721c5b8ac4f562cdca45edb8384dca41bba6c3 Mon Sep 17 00:00:00 2001 From: Hatatister Date: Sun, 11 Aug 2019 20:42:36 +0200 Subject: [PATCH] changed way of checking exception message in loft wire checking unit test to increase code coverage --- tests/TestCadQuery.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/TestCadQuery.py b/tests/TestCadQuery.py index 644c242c..6a93374d 100644 --- a/tests/TestCadQuery.py +++ b/tests/TestCadQuery.py @@ -261,11 +261,10 @@ class TestCadQuery(BaseTest): def testLoftWithOneWireRaisesValueError(self): s = Workplane("XY").circle(5) - try: + with self.assertRaises(ValueError) as cm: s.loft() - self.assertFail() - except ValueError as e: - self.assertEqual(str(e), "More than one wire is required") + err = cm.exception + self.assertEqual(str(err), "More than one wire is required") def testLoftCombine(self):