Skip to content

Commit

Permalink
fixed all storage providers being used regardless of opts
Browse files Browse the repository at this point in the history
  • Loading branch information
verbose-void authored Jun 12, 2021
1 parent f73ec93 commit 017a626
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,22 @@ def _storage_from_request(request):
cache_sizes = []

if MEMORY in requested_providers:
if _is_opt_true(request, MEMORY_OPT):
pytest.skip()

storage_providers.append(_get_memory_provider(request))
cache_sizes.append(MIN_FIRST_CACHE_SIZE)
if LOCAL in requested_providers:
if not _is_opt_true(request, LOCAL_OPT):
pytest.skip()

storage_providers.append(_get_local_provider(request))
cache_size = MIN_FIRST_CACHE_SIZE if not cache_sizes else MIN_SECOND_CACHE_SIZE
cache_sizes.append(cache_size)
if S3 in requested_providers:
if not _is_opt_true(request, S3_OPT):
pytest.skip()

storage_providers.append(_get_s3_provider(request))

if len(storage_providers) == len(cache_sizes):
Expand Down Expand Up @@ -214,8 +223,8 @@ def s3_storage(request):


@pytest.fixture
def storage(request, memory_storage, local_storage, s3_storage):
return _storage_from_request(request, memory_storage, local_storage, s3_storage)
def storage(request):
return _storage_from_request(request)


@pytest.fixture
Expand All @@ -235,9 +244,7 @@ def s3_ds(s3_storage):

@pytest.fixture
def ds(request):
return _get_dataset(
_storage_from_request(request)
)
return _get_dataset(_storage_from_request(request))


def print_session_id():
Expand Down

0 comments on commit 017a626

Please sign in to comment.