Skip to content

Commit 1b7851d

Browse files
author
David Butterworth
committed
Modify Unit Test CheckJointLimits_MinLimitAll to use assertRaises().
1 parent 9c2786b commit 1b7851d

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
@@ -199,15 +199,8 @@ def test_CheckJointLimits_MinLimitOneJoint(self):
199199
def test_CheckJointLimits_MinLimitAll(self):
200200
# This configuration is beyond the min limits
201201
q0 = [-2.7, -2.0, -2.8, -0.9, -4.9, -1.6, -3.1]
202-
try:
202+
with self.assertRaises(JointLimitError):
203203
prpy.util.CheckJointLimits(self.robot, q0)
204-
except JointLimitError:
205-
pass # test passed
206-
except Exception, e:
207-
error = 'Unexpected exception thrown: ' + str(e.message)
208-
self.fail(error)
209-
else:
210-
self.fail('Expected exception not thrown')
211204

212205
def test_CheckJointLimits_MaxLimitOneJoint(self):
213206
# Individually check for when one joint is beyond the max limit

0 commit comments

Comments
 (0)