Skip to content

Commit

Permalink
MOved test_can_validate_stub_dataset_sources to use asyncio.gather
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Oct 16, 2024
1 parent dba3e7f commit 7584d08
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_task.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
from collections.abc import Iterable
from unittest.mock import patch

Expand Down Expand Up @@ -99,10 +100,10 @@ async def test___len__(
async def test_can_validate_stub_dataset_sources(
self, base_query_request: QueryRequest
) -> None:
dataset = StubLitQADataset(base_query=base_query_request)
for i in range(len(dataset)):
env = dataset.get_new_env_by_idx(i)
await env.validate_sources()
ds = StubLitQADataset(base_query=base_query_request)
await asyncio.gather(
*(ds.get_new_env_by_idx(i).validate_sources() for i in range(len(ds)))
)

@pytest.mark.asyncio
async def test_evaluation(self, base_query_request: QueryRequest) -> None:
Expand Down

0 comments on commit 7584d08

Please sign in to comment.