From 253e41ccad7216a9a656a82d101b98b40b112e16 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Wed, 28 Sep 2016 00:59:21 +1000 Subject: [PATCH] Relax constraints on testing to ensure they work in all cases. --- tests/test_chrono.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_chrono.py b/tests/test_chrono.py index 0253550d9..b1d4dc72f 100644 --- a/tests/test_chrono.py +++ b/tests/test_chrono.py @@ -18,8 +18,10 @@ def test_chrono_system_clock(): assert diff.days == 0 assert diff.seconds == 0 - # 50 milliseconds is a very long time to execute this - assert diff.microseconds < 50000 + # We test that no more than about 0.5 seconds passes here + # This makes sure that the dates created are very close to the same + # but if the testing system is incredibly overloaded this should still pass + assert diff.microseconds < 500000 def test_chrono_system_clock_roundtrip(): @@ -111,4 +113,4 @@ def test_floating_point_duration(): assert isinstance(time, datetime.timedelta) assert time.seconds == 35 - assert time.microseconds == 525123 + assert 525122 <= time.microseconds <= 525123