From 46c89816ca0fe443b581d5596a257dc259718f76 Mon Sep 17 00:00:00 2001 From: Joshua Smock Date: Tue, 7 Apr 2026 12:43:27 +0200 Subject: [PATCH] Use API key from environment if available --- tests/integration/features/environment.py | 1 + tests/integration/features/steps/cli_steps.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/features/environment.py b/tests/integration/features/environment.py index efd5f664..5822e14e 100644 --- a/tests/integration/features/environment.py +++ b/tests/integration/features/environment.py @@ -19,6 +19,7 @@ def before_scenario(context, scenario): # Create a temporary working directory for this scenario context.temp_dir = tempfile.mkdtemp(prefix="tower_test_") context.original_cwd = os.getcwd() + context.api_key = os.environ.get("TOWER_API_KEY", "sk-test-api-key") os.chdir(context.temp_dir) diff --git a/tests/integration/features/steps/cli_steps.py b/tests/integration/features/steps/cli_steps.py index fb6d463f..e13dc785 100644 --- a/tests/integration/features/steps/cli_steps.py +++ b/tests/integration/features/steps/cli_steps.py @@ -70,7 +70,7 @@ def step_run_cli_command_with_api_key(context, command): test_env["FORCE_COLOR"] = "1" test_env["CLICOLOR_FORCE"] = "1" test_env["TOWER_URL"] = context.tower_url - test_env["TOWER_API_KEY"] = "sk-test-api-key" + test_env["TOWER_API_KEY"] = context.api_key # Use a temp HOME with no session.json to prove API key auth works standalone test_env["HOME"] = context.temp_dir