Skip to content

Commit

Permalink
Skip if on CI and API key is empty string
Browse files Browse the repository at this point in the history
"With the exception of GITHUB_TOKEN, secrets are not passed to the
 runner when a workflow is triggered from a forked repository."
  • Loading branch information
zmoon committed Sep 11, 2024
1 parent bbc16ec commit 4490a50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_openaq_v2.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import sys
import os

import pandas as pd
import pytest

import monetio.obs.openaq_v2 as openaq

if sys.version_info < (3, 7):
pytest.skip("asdf", allow_module_level=True)
if (
os.environ.get("CI", "false").lower() not in {"false", "0"}
and os.environ.get("OPENAQ_API_KEY", "") == ""
):
# PRs from forks don't get the secret
pytest.skip("no API key", allow_module_level=True)

LATLON_NCWCP = 38.9721, -76.9248
SITES_NEAR_NCWCP = [
Expand Down

0 comments on commit 4490a50

Please sign in to comment.