Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions tests/test_data/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import pytest

from luxonis_ml.data import BucketStorage


def pytest_addoption(parser):
parser.addoption(
"--only-local",
action="store_true",
default=False,
help="Run tests only for local storage",
)


@pytest.fixture
def only_local(request):
return request.config.getoption("--only-local")

Check warning on line 17 in tests/test_data/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data/conftest.py#L17

Added line #L17 was not covered by tests


@pytest.fixture
def storage_options(only_local: bool):
if only_local:
return [BucketStorage.LOCAL]
return [BucketStorage.LOCAL, BucketStorage.GCS, BucketStorage.S3]

Check warning on line 24 in tests/test_data/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/test_data/conftest.py#L22-L24

Added lines #L22 - L24 were not covered by tests


def pytest_generate_tests(metafunc):
if "bucket_storage" in metafunc.fixturenames:
only_local = metafunc.config.getoption("--only-local")
storage_options = (
[BucketStorage.LOCAL]
if only_local
else [BucketStorage.LOCAL, BucketStorage.S3, BucketStorage.GCS]
)
metafunc.parametrize("bucket_storage", storage_options)
22 changes: 0 additions & 22 deletions tests/test_data/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ def make_image(i) -> Path:
return path


@pytest.mark.parametrize(
("bucket_storage",),
[
(BucketStorage.LOCAL,),
(BucketStorage.S3,),
(BucketStorage.GCS,),
],
)
def test_dataset(
bucket_storage: BucketStorage,
platform_name: str,
Expand Down Expand Up @@ -214,13 +206,6 @@ def _raise(*_):
_ = loader[0]


@pytest.mark.parametrize(
("bucket_storage",),
[
(BucketStorage.LOCAL,),
(BucketStorage.GCS,),
],
)
def test_make_splits(
bucket_storage: BucketStorage, platform_name: str, python_version: str
):
Expand Down Expand Up @@ -519,13 +504,6 @@ def generator():
}


@pytest.mark.parametrize(
("bucket_storage",),
[
(BucketStorage.LOCAL,),
(BucketStorage.GCS,),
],
)
def test_uncommon_label_types(
bucket_storage: BucketStorage, platform_name: str, python_version: str
):
Expand Down
8 changes: 0 additions & 8 deletions tests/test_data/test_task_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ def compute_histogram(dataset: LuxonisDataset) -> Dict[str, int]:
return dict(classes)


@pytest.mark.parametrize(
("bucket_storage",),
[
(BucketStorage.LOCAL,),
(BucketStorage.S3,),
(BucketStorage.GCS,),
],
)
def test_task_ingestion(
bucket_storage: BucketStorage, platform_name: str, python_version: str
):
Expand Down
Loading