Skip to content

Commit

Permalink
💨 Speed up datamodule tests (#843)
Browse files Browse the repository at this point in the history
test subset splitting only with folder
  • Loading branch information
djdameln authored Jan 16, 2023
1 parent ebb55aa commit ce70716
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/pre_merge/datasets/test_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ def test_image_size(self, input_size, effective_image_size, category="shapes", p


class TestSubsetSplitting:
@pytest.mark.parametrize("dataset", ["folder", "mvtec", "btech"])
# @pytest.mark.parametrize("dataset", ["folder"])
@pytest.mark.parametrize("dataset", ["folder"])
@pytest.mark.parametrize("test_split_mode", ("from_dir", "synthetic"))
@pytest.mark.parametrize("val_split_mode", ("from_test", "synthetic"))
def test_non_overlapping_splits(self, make_data_module, dataset, test_split_mode, val_split_mode):
Expand All @@ -318,8 +317,7 @@ def test_non_overlapping_splits(self, make_data_module, dataset, test_split_mode
assert len(set(train_samples.image_path).intersection(set(test_samples.image_path))) == 0
assert len(set(val_samples.image_path).intersection(set(test_samples.image_path))) == 0

@pytest.mark.parametrize("dataset", ["folder", "mvtec", "btech"])
# @pytest.mark.parametrize("dataset", ["folder"])
@pytest.mark.parametrize("dataset", ["folder"])
@pytest.mark.parametrize("test_split_mode", ("from_dir", "synthetic"))
def test_equal_splits(self, make_data_module, dataset, test_split_mode):
"""Tests if test and and val splits are equal and non-overlapping with train."""
Expand Down

0 comments on commit ce70716

Please sign in to comment.