From 8192310dadfbb25d6e9ec052373bc0584390fb7a Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Sun, 27 Sep 2015 12:32:02 +0200 Subject: [PATCH] tests/wipy: Improve robustness of time test. --- tests/wipy/time.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/wipy/time.py b/tests/wipy/time.py index d6b4f245d6..416f0cf51c 100644 --- a/tests/wipy/time.py +++ b/tests/wipy/time.py @@ -61,12 +61,12 @@ spot_test(-1072915201, (1965, 12, 31, 23, 59, 59, 4, 365)) t1 = time.time() time.sleep(2) t2 = time.time() -print(time.ticks_diff(t1, t2) == 2) +print(abs(time.ticks_diff(t1, t2) -2) <= 1) t1 = time.ticks_ms() time.sleep_ms(50) t2 = time.ticks_ms() -print(time.ticks_diff(t1, t2) == 50) +print(abs(time.ticks_diff(t1, t2)- 50) <= 1) t1 = time.ticks_us() time.sleep_us(1000)