Skip to content

Commit

Permalink
Set token id + secret in test fixtures w subprocesses
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed Oct 18, 2024
1 parent 25ce086 commit 8458296
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,8 @@ async def container_client(servicer):
@pytest_asyncio.fixture(scope="function")
async def server_url_env(servicer, monkeypatch):
monkeypatch.setenv("MODAL_SERVER_URL", servicer.client_addr)
monkeypatch.setenv("MODAL_TOKEN_ID", "ak-123")
monkeypatch.setenv("MODAL_TOKEN_SECRET", "as-123")
yield


Expand Down
9 changes: 8 additions & 1 deletion test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ def deploy_app_externally(
**{"PYTHONUTF8": "1"},
} # windows apparently needs a bunch of env vars to start python...

env = {**windows_support, "MODAL_SERVER_URL": servicer.client_addr, "MODAL_ENVIRONMENT": "main", **env}
env = {
**windows_support,
"MODAL_SERVER_URL": servicer.client_addr,
"MODAL_ENVIRONMENT": "main",
"MODAL_TOKEN_ID": "ak-123",
"MODAL_TOKEN_SECRET": "as-123",
**env,
}
if cwd is None:
cwd = pathlib.Path(__file__).parent.parent

Expand Down

0 comments on commit 8458296

Please sign in to comment.