Skip to content

Commit

Permalink
fix failing tests bcoz of generators
Browse files Browse the repository at this point in the history
  • Loading branch information
deependujha committed Jul 8, 2024
1 parent 30a6ce8 commit 575615c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/streaming/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def test_dataset_with_mosaic_mds_data(tmpdir):
for batch in dataloader:
assert len(batch["class"]) == 4
assert len(batch["image"]) == 4
assert (_class for _class in batch["class"]) == [4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3]
assert list(batch["class"]) == [4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3]
i += 1

dataloader = DataLoader(dataset, batch_size=4, drop_last=False)
Expand All @@ -1056,9 +1056,9 @@ def test_dataset_with_mosaic_mds_data(tmpdir):
# last batch is smaller than batch_size
assert len(batch["class"]) == 2
assert len(batch["image"]) == 2
assert (_class for _class in batch["class"]) == [4 * i, 4 * i + 1]
assert list(batch["class"]) == [4 * i, 4 * i + 1]
break
assert len(batch["class"]) == 4
assert len(batch["image"]) == 4
assert (_class for _class in batch["class"]) == [4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3]
assert list(batch["class"]) == [4 * i, 4 * i + 1, 4 * i + 2, 4 * i + 3]
i += 1

0 comments on commit 575615c

Please sign in to comment.