From 84582963f361cabc0f8113a56e7fa5b235eab2f5 Mon Sep 17 00:00:00 2001 From: Erik Bernhardsson Date: Fri, 18 Oct 2024 22:27:43 +0000 Subject: [PATCH] Set token id + secret in test fixtures w subprocesses --- test/conftest.py | 2 ++ test/helpers.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/conftest.py b/test/conftest.py index 6520219b4..4a314cdd4 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -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 diff --git a/test/helpers.py b/test/helpers.py index 7064d1057..d726218db 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -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