diff --git a/tests/sinqMotor/limits.py b/tests/sinqMotor/limits.py index 63e37f5..feee65c 100644 --- a/tests/sinqMotor/limits.py +++ b/tests/sinqMotor/limits.py @@ -1,4 +1,5 @@ import time +import math def reread_limits_from_hw(motor): @@ -15,7 +16,11 @@ def reread_limits_from_hw(motor): time.sleep(2) # Values should have been reread - assert motor.read_field('highlimit') == high_limit - assert motor.read_field('lowlimit') == low_limit - assert motor.read_field('dialhighlimit') == high_limit - assert motor.read_field('diallowlimit') == low_limit + assert math.isclose(motor.read_field('highlimit'), + high_limit, rel_tol=1e-9, abs_tol=0.001) + assert math.isclose(motor.read_field('lowlimit'), + low_limit, rel_tol=1e-9, abs_tol=0.001) + assert math.isclose(motor.read_field('dialhighlimit'), + high_limit, rel_tol=1e-9, abs_tol=0.001) + assert math.isclose(motor.read_field('diallowlimit'), + low_limit, rel_tol=1e-9, abs_tol=0.001)