Skip to content

Commit 1199144

Browse files
authored
add test to enforce __len__ is working on prototype datasets (#5742)
1 parent fb56882 commit 1199144

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/test_prototype_builtin_datasets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ def test_infinite_buffer_size(self, test_home, dataset_mock, config):
175175
# resolved
176176
assert dp.buffer_size == INFINITE_BUFFER_SIZE
177177

178+
@parametrize_dataset_mocks(DATASET_MOCKS)
179+
def test_has_length(self, test_home, dataset_mock, config):
180+
dataset_mock.prepare(test_home, config)
181+
dataset = datasets.load(dataset_mock.name, **config)
182+
183+
assert len(dataset) > 0
184+
178185

179186
@parametrize_dataset_mocks(DATASET_MOCKS["qmnist"])
180187
class TestQMNIST:

0 commit comments

Comments
 (0)