Skip to content

Commit e90a4dd

Browse files
committed
Add flow log env propagation test
1 parent 900c0c6 commit e90a4dd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_local_server.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,28 @@ def test_local_mode_masks_inherited_model_api_key_envs_and_prefers_explicit_para
284284
assert captured_env["MODEL_API_KEY"] == expected_model_api_key
285285
assert captured_env["OPENAI_API_KEY"] == "bad2"
286286
client.close()
287+
288+
289+
def test_local_mode_forwards_flow_log_and_config_dir_env_to_sea_binary(
290+
monkeypatch: pytest.MonkeyPatch,
291+
tmp_path: Path,
292+
) -> None:
293+
_set_required_env(monkeypatch)
294+
monkeypatch.setenv("BROWSERBASE_FLOW_LOGS", "1")
295+
monkeypatch.setenv("BROWSERBASE_CONFIG_DIR", "./tmp")
296+
297+
captured_env: dict[str, str] = {}
298+
_install_fake_sea_runtime(monkeypatch, tmp_path, captured_env, port=43131)
299+
300+
client = Stagehand(
301+
server="local",
302+
model_api_key="model_key",
303+
_local_stagehand_binary_path="/does/not/matter/in/test",
304+
)
305+
assert client._sea_server is not None
306+
307+
client._sea_server.ensure_running_sync()
308+
309+
assert captured_env["BROWSERBASE_FLOW_LOGS"] == "1"
310+
assert captured_env["BROWSERBASE_CONFIG_DIR"] == "./tmp"
311+
client.close()

0 commit comments

Comments
 (0)