Skip to content

Commit

Permalink
iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Mar 24, 2021
1 parent ec2ab00 commit f8d9fb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ def wait_for(func, timeout=60):
"""Check for function to finish."""
time: datetime = datetime.utcnow()
timeout_diff: timedelta = timedelta(seconds=timeout)
i = 0
while True:
i += 1
try:
func()
return
except AssertionError as e:
if time + timeout_diff < datetime.utcnow():
raise e
raise AssertionError("Faile after {i} attempts".format(i=i)) from e
sleep(1)
pass

Expand Down

0 comments on commit f8d9fb0

Please sign in to comment.