Skip to content

Commit

Permalink
Add comment in fixed unit test. Add retry limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
lrzpellegrini committed Jan 25, 2024
1 parent a65de4c commit 96838ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/benchmarks/scenarios/test_task_aware.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class TestsTaskAware(unittest.TestCase):
def test_taskaware(self):
"""Common use case: add tas labels to class-incremental benchmark."""
n_classes, n_samples_per_class, n_features = 10, 3, 7
while True:

for _ in range(10000):
dataset = make_classification(
n_samples=n_classes * n_samples_per_class,
n_classes=n_classes,
Expand All @@ -25,6 +26,9 @@ def test_taskaware(self):
n_redundant=0,
)

# The following check is required to ensure that at least 2 exemplars
# per class are generated. Otherwise, the train_test_split function will
# fail.
_, unique_count = np.unique(dataset[1], return_counts=True)
if np.min(unique_count) > 1:
break
Expand Down

0 comments on commit 96838ed

Please sign in to comment.