Skip to content

Commit

Permalink
longer sleep in clock test
Browse files Browse the repository at this point in the history
  • Loading branch information
slayoo committed Jan 2, 2024
1 parent 42638a4 commit 25a07f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/unit_tests/test_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ def test():
def test_clock_value():
# Arrange
factor = 3
base = 0.01
base = 0.1

start = clock()
time.sleep(base)
sec_one = clock() - start
sec_base = clock() - start

# Act
start = clock()
time.sleep(base * factor)
sec_two = clock() - start
sec_factor = clock() - start

# Assert
assert abs(sec_two / sec_one - factor) < 0.1
assert abs(sec_factor / sec_base - factor) < 0.1

0 comments on commit 25a07f1

Please sign in to comment.