Skip to content

Commit 1dda21f

Browse files
author
David Butterworth
committed
Modify Unit Test CheckJointLimits_MaxLimitAll to use assertRaises().
1 parent 1b7851d commit 1dda21f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/test_util.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,8 @@ def test_CheckJointLimits_MaxLimitOneJoint(self):
213213
def test_CheckJointLimits_MaxLimitAll(self):
214214
# This configuration is beyond the max limits
215215
q0 = [2.7, 2.0, 2.8, 0.9, 4.9, 1.6, 3.1]
216-
try:
216+
with self.assertRaises(JointLimitError):
217217
prpy.util.CheckJointLimits(self.robot, q0)
218-
except JointLimitError:
219-
pass # test passed
220-
except Exception, e:
221-
error = 'Unexpected exception thrown: ' + str(e.message)
222-
self.fail(error)
223-
else:
224-
self.fail('Expected exception not thrown')
225218

226219
def test_CheckJointLimits_ZeroPosition(self):
227220
# Check the zero position, which should succeed

0 commit comments

Comments
 (0)