Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pytest-env to set up API key #3272

Merged
merged 9 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions catalog/env.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ 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
#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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**I actually think we can do away with most of these, maybe leaving one as an example!

Suggested change
#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