Skip to content

Commit

Permalink
make tests more lenient
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Jun 20, 2024
1 parent 63150cc commit 6126895
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/extract/test_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ async def r_async():
async_list = list(r_async().add_limit(max_time=1))

# we should have extracted 10 items within 1 second, sleep is included in the resource
allowed_results = [list(range(11)), list(range(10)), list(range(9))]
allowed_results = [
list(range(12)),
list(range(11)),
list(range(10)),
list(range(9)),
list(range(8)),
]
assert sync_list in allowed_results
assert async_list in allowed_results

Expand All @@ -99,7 +105,13 @@ async def r_async():
async_list = list(r_async().add_limit(max_time=1, min_wait=0.2))

# we should have extracted about 5 items within 1 second, sleep is done via min_wait
allowed_results = [list(range(4)), list(range(5)), list(range(6))]
allowed_results = [
list(range(3)),
list(range(4)),
list(range(5)),
list(range(6)),
list(range(7)),
]
assert sync_list in allowed_results
assert async_list in allowed_results

Expand Down

0 comments on commit 6126895

Please sign in to comment.