Skip to content

Commit 2e39977

Browse files
committed
Fix test cases for gather_results: remove erroneous exception handling and ensure correct assertions
1 parent 5472ed9 commit 2e39977

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

examples/async_worker/tests/test_worker.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
@pytest.mark.asyncio
77
async def test_gather_results_returns_values():
88
jobs = [Job("one", 0.0, 1), Job("two", 0.0, 2)]
9-
with pytest.raises((TypeError, RuntimeError)):
10-
# BUG: gather_results returns unfinished awaitables
11-
await gather_results(jobs)
9+
# gather_results should return the processed values
10+
assert await gather_results(jobs) == [1, 2]
1211

1312

1413
@pytest.mark.asyncio
15-
@pytest.mark.xfail(reason="await missing in gather_results", strict=True)
1614
async def test_gather_results_success():
1715
jobs = [Job("one", 0.0, 1), Job("two", 0.0, 2)]
1816
assert await gather_results(jobs) == [1, 2]

0 commit comments

Comments
 (0)