Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aggregate tests #155

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions tests/test_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ async def test_max_count(loop):
@aggregate(leeway * 1000, max_count)
async def pow(*args: float, power: float = 2) -> List[float]:
nonlocal t_exec
await asyncio.sleep(0.03)
t_exec = time.time()
event.set()

Expand Down Expand Up @@ -151,7 +150,6 @@ async def test_max_count_multiple_batches(loop):
@aggregate(leeway * 1000, max_count)
async def pow(*args: float, power: float = 2) -> List[float]:
nonlocal t_exec
await asyncio.sleep(0.03)
t_exec = time.time()
event.set()

Expand All @@ -167,7 +165,7 @@ async def pow(*args: float, power: float = 2) -> List[float]:
await event.wait()
event.clear()
elapsed = t_exec - t
assert 0 < elapsed < leeway * 2
assert 0 < elapsed < leeway

await wait(tasks[:5])
for i in range(5):
Expand Down Expand Up @@ -258,7 +256,6 @@ async def test_max_count_cancel(loop):
@aggregate(leeway * 1000, max_count)
async def pow(*args: float, power: float = 2) -> List[float]:
nonlocal executions, executing_task, t_exec, delay_exec
await asyncio.sleep(0.03)
t_exec = time.time()
executions += 1
executing_task = tasks[arg.get()]
Expand Down