Skip to content

Commit

Permalink
fix(datasets:skip) Update tests for multiple partitioners (#3830)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-narozniak authored Jul 18, 2024
1 parent 247012e commit 02b1959
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datasets/flwr_datasets/federated_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def test_multiple_partitioners(self) -> None:
dataset_test_partition0 = dataset_fds.load_partition(0, self.test_split)

dataset = datasets.load_dataset(self.dataset_name)
self.assertEqual(
len(dataset_test_partition0),
len(dataset[self.test_split]) // num_test_partitions,
)
expected_len = len(dataset[self.test_split]) // num_test_partitions
mod = len(dataset[self.test_split]) % num_test_partitions
expected_len += 1 if 0 < mod else 0
self.assertEqual(len(dataset_test_partition0), expected_len)

def test_no_need_for_split_keyword_if_one_partitioner(self) -> None:
"""Test if partitions got with and without split args are the same."""
Expand Down

0 comments on commit 02b1959

Please sign in to comment.