Skip to content

Commit

Permalink
Merge pull request #1285 from dhiganthrao/fix/pytest_gcs
Browse files Browse the repository at this point in the history
Add pytest fixture decorator to test_gcs_tokens
  • Loading branch information
dhiganthrao authored Oct 23, 2021
2 parents 33b6d89 + 5ba6772 commit bfcced8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hub/core/storage/tests/test_storage_provider.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import json
from hub.tests.path_fixtures import gcs_creds
from hub.tests.common import is_opt_true
from hub.tests.storage_fixtures import enabled_storages, enabled_persistent_storages
from hub.tests.cache_fixtures import enabled_cache_chains
from hub.core.storage.gcs import GCloudCredentials
from hub.util.exceptions import GCSDefaultCredsNotFoundError
import os
import pytest
from hub.constants import MB
from hub.constants import MB, GCS_OPT
import pickle


Expand Down Expand Up @@ -139,7 +140,11 @@ def test_pickling(storage):
assert unpickled_storage[FILE_1] == b"hello world"


def test_gcs_tokens():
@pytest.fixture
def test_gcs_tokens(request):
if not is_opt_true(request, GCS_OPT):
pytest.skip()
return
gcreds = GCloudCredentials()
assert gcreds.credentials
token_path = os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
Expand Down

0 comments on commit bfcced8

Please sign in to comment.