Skip to content

Commit

Permalink
update unit test to check for shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusOrsoe committed Apr 12, 2024
1 parent db090ae commit fb80af8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/data/test_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def dataset_setup(dataset_ref: pytest.FixtureRequest) -> tuple:
"graph_definition": graph_definition,
}

dataloader_kwargs = {"batch_size": 2, "num_workers": 1}
dataloader_kwargs = {"batch_size": 2, "num_workers": 1, "shuffle": True}

return dataset_ref, dataset_kwargs, dataloader_kwargs

Expand Down Expand Up @@ -210,6 +210,11 @@ def test_single_dataset_with_selections(
# Training dataloader should have more batches
assert len(train_dataloader) > len(val_dataloader)

# validation loader should have shuffle = False by default
assert isinstance(val_dataloader.sampler, SequentialSampler)
# test loader should have shuffle = False by default
assert isinstance(test_dataloader.sampler, SequentialSampler)


@pytest.mark.parametrize(
"dataset_ref", [SQLiteDataset, ParquetDataset], indirect=True
Expand Down

0 comments on commit fb80af8

Please sign in to comment.