diff --git a/tests/fixtures.py b/tests/fixtures.py index ac1b97fb3..d14e542fb 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -34,7 +34,7 @@ @pytest.fixture def testing_empty_hf_org_id(org_id: str = TESTING_EMPTY_HF_ORG_ID): old_token = os.getenv("HF_TOKEN") - os.environ["HF_TOKEN"] = os.getenv("HF_TEST_TOKEN") + os.environ["HF_TOKEN"] = os.getenv("HF_TEST_TOKEN") or "" def list_repos(org_id: str): return list(hf_api.list_models(author=org_id)) + list(hf_api.list_datasets(author=org_id)) diff --git a/tests/logging/test_evaluation_tracker.py b/tests/logging/test_evaluation_tracker.py index 1712616b9..a3df1e375 100644 --- a/tests/logging/test_evaluation_tracker.py +++ b/tests/logging/test_evaluation_tracker.py @@ -126,6 +126,10 @@ def test_no_details_output(mock_evaluation_tracker: EvaluationTracker): assert not details_dir.exists() +@pytest.mark.skipif( + reason="Secrets are not available in this environment", + condition=os.getenv("HF_TEST_TOKEN") is None, +) @pytest.mark.evaluation_tracker(push_to_hub=True, hub_results_org=TESTING_EMPTY_HF_ORG_ID) def test_push_to_hub_works(testing_empty_hf_org_id, mock_evaluation_tracker: EvaluationTracker, mock_datetime): # Prepare the dummy data