Commit 253e41cc by Trent Houliston

Relax constraints on testing to ensure they work in all cases.

parent ad3bb9bb
...@@ -18,8 +18,10 @@ def test_chrono_system_clock(): ...@@ -18,8 +18,10 @@ def test_chrono_system_clock():
assert diff.days == 0 assert diff.days == 0
assert diff.seconds == 0 assert diff.seconds == 0
# 50 milliseconds is a very long time to execute this # We test that no more than about 0.5 seconds passes here
assert diff.microseconds < 50000 # 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(): def test_chrono_system_clock_roundtrip():
...@@ -111,4 +113,4 @@ def test_floating_point_duration(): ...@@ -111,4 +113,4 @@ def test_floating_point_duration():
assert isinstance(time, datetime.timedelta) assert isinstance(time, datetime.timedelta)
assert time.seconds == 35 assert time.seconds == 35
assert time.microseconds == 525123 assert 525122 <= time.microseconds <= 525123
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment