From b85df6d9ed43f8959481bf706fc18234e771ac27 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 5 May 2020 14:36:04 +0200 Subject: [PATCH] tests: Change unreliable ClockObject test The tests are randomly failing due to more time being elapsed. On a busy buildbot we don't really have any guarantee that the test doesn't take longer than the threshold. --- tests/putil/test_clockobject.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/putil/test_clockobject.py b/tests/putil/test_clockobject.py index 76c131b5f6..1bb563a0ee 100644 --- a/tests/putil/test_clockobject.py +++ b/tests/putil/test_clockobject.py @@ -1,5 +1,4 @@ import time -from pytest import approx def test_clock_get_frame_time(clockobj): @@ -17,13 +16,13 @@ def test_clock_jump_frame_time(clockobj): def test_clock_get_real_time(clockobj): current_time = clockobj.get_real_time() time.sleep(0.4) - assert clockobj.get_real_time() - current_time == approx(0.4, 0.1) + assert clockobj.get_real_time() - current_time >= 0.4 def test_clock_get_long_time(clockobj): current_time = clockobj.get_long_time() time.sleep(0.4) - assert clockobj.get_long_time() - current_time == approx(0.4, 0.1) + assert clockobj.get_long_time() - current_time >= 0.4 def test_clock_get_dt(clockobj):