Skip to content

Commit

Permalink
Use pytest-env to set up API key (#3272)
Browse files Browse the repository at this point in the history
* install pytest-env, comment api_key and add pytest env

* change placeholder name

* shorten api key name

* remove default

* edit name

* edit variable name and checkout pipfile

* remove pytest-env from pipfile

* remove pipfile

* remove comment and add an example
  • Loading branch information
ngken0995 authored Nov 6, 2023
1 parent a6293ea commit 910cc68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
13 changes: 2 additions & 11 deletions catalog/env.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,8 @@ AIRFLOW_VAR_ENVIRONMENT=dev
# API Keys
########################################################################################
# See: https://airflow.apache.org/docs/apache-airflow/stable/howto/variable.html#storing-variables-in-environment-variables
AIRFLOW_VAR_API_KEY_BROOKLYN_MUSEUM=not_set
AIRFLOW_VAR_API_KEY_DATA_GOV=not_set
AIRFLOW_VAR_API_KEY_EUROPEANA=not_set
AIRFLOW_VAR_API_KEY_FLICKR=not_set
AIRFLOW_VAR_API_KEY_FREESOUND=not_set
AIRFLOW_VAR_API_KEY_JAMENDO=not_set
AIRFLOW_VAR_API_KEY_JUSTTAKEITFREE=not_set
AIRFLOW_VAR_API_KEY_NYPL=not_set
AIRFLOW_VAR_API_KEY_RAWPIXEL=not_set
AIRFLOW_VAR_API_KEY_THINGIVERSE=not_set
AIRFLOW_VAR_API_KEY_WALTERS_ART_MUSEUM=not_set
# Example:
# AIRFLOW_VAR_API_KEY_BROOKLYN_MUSEUM=apikey


########################################################################################
Expand Down
13 changes: 13 additions & 0 deletions catalog/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@ filterwarnings=
# structure due to permissions issues
# https://stackoverflow.com/a/56493748/3277713
cache_dir=/home/airflow/.cache/pytest

env =
AIRFLOW_VAR_API_KEY_BROOKLYN_MUSEUM=apikey
AIRFLOW_VAR_API_KEY_DATA_GOV=apikey
AIRFLOW_VAR_API_KEY_EUROPEANA=apikey
AIRFLOW_VAR_API_KEY_FLICKR=apikey
AIRFLOW_VAR_API_KEY_FREESOUND=apikey
AIRFLOW_VAR_API_KEY_JAMENDO=apikey
AIRFLOW_VAR_API_KEY_JUSTTAKEITFREE=apikey
AIRFLOW_VAR_API_KEY_NYPL=apikey
AIRFLOW_VAR_API_KEY_RAWPIXEL=apikey
AIRFLOW_VAR_API_KEY_THINGIVERSE=apikey
AIRFLOW_VAR_API_KEY_WALTERS_ART_MUSEUM=apikey
1 change: 1 addition & 0 deletions catalog/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
flaky==3.7.0
ipython
pook==1.1.1
pytest-env
pytest-mock==3.11.1
pytest-raises==0.11
pytest-socket==0.6.0
Expand Down

0 comments on commit 910cc68

Please sign in to comment.