Skip to content
This repository was archived by the owner on Jul 26, 2020. It is now read-only.

Commit 843e455

Browse files
committed
clarify parameters of tests are degrees or radians
1 parent 0e066c8 commit 843e455

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_orientation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ def test_image_coordinates(photo, expected_orientation):
6666
vision = Vision(camera)
6767
token, = vision.snapshot()
6868

69-
def approx_ang(expected):
70-
return approx(expected, abs=ROTATION_TOLERANCE_DEGREES)
69+
def approx_ang(expected_degrees):
70+
return approx(expected_degrees, abs=ROTATION_TOLERANCE_DEGREES)
7171

72-
def assert_angle(angle, expected, message):
73-
expected = approx_ang(math.degrees(expected))
72+
def assert_angle(angle_radians, expected_degrees, message):
73+
expected_degrees = approx_ang(math.degrees(expected_degrees))
7474
# Check both +0 and +360 so approx can cover the jump between -180 and 180
75-
assert math.degrees(angle) == expected or math.degrees(angle) + 360 == expected, \
75+
assert math.degrees(angle_radians) == expected_degrees or math.degrees(angle_radians) + 360 == expected_degrees, \
7676
message
7777

7878
rot_x, rot_y, rot_z = token.orientation

0 commit comments

Comments
 (0)