Skip to content

Commit

Permalink
Add dotenv to requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
masonhargrave committed Jan 4, 2025
1 parent f9f02ba commit 4f71997
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Flask
SQLAlchemy
requests
python_jose
python_jose
python-dotenv
13 changes: 11 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
import pytest
from main import app

# Load environment variables
load_dotenv()
# Load .env for local development
if os.path.exists(".env"):
load_dotenv()

AUTH0_DOMAIN = os.getenv("AUTH0_DOMAIN")
AUTH0_API_AUDIENCE = os.getenv("AUTH0_API_AUDIENCE")
AUTH0_CLIENT_ID = os.getenv("AUTH0_CLIENT_ID")
AUTH0_CLIENT_SECRET = os.getenv("AUTH0_CLIENT_SECRET")

if not all([AUTH0_DOMAIN, AUTH0_API_AUDIENCE, AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET]):
raise EnvironmentError("Missing one or more required Auth0 environment variables.")


@pytest.fixture
Expand Down

0 comments on commit 4f71997

Please sign in to comment.