Skip to content

Commit cd90d5c

Browse files
dougborgclaude
andcommitted
test(mcp): suppress webbrowser.open during browser-test fixture
`fastmcp dev apps` (spawned by the browser-test fixture) unconditionally calls `webbrowser.open(dev_url)` at startup with no flag to disable. Set BROWSER=true in the subprocess env so Python's webbrowser module dispatches to the `true` command (resolved via PATH — exits 0, opens nothing) instead of macOS's AppleScript browser-opener. Playwright continues to drive headless Chromium for the actual render tests; only the spurious developer-facing window is gone. The override is skipped on Windows — there's no `true` command there, and webbrowser would fall through to the default browser. The suite is documented as macOS/Linux-only anyway, matching the `start_new_session` guard a few lines below. uv.lock is the workspace-version bump from `client v0.62.0` on main, bundled per CLAUDE.md to keep the lockfile in sync with pyproject.toml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 733a10c commit cd90d5c

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

katana_mcp_server/tests/browser/conftest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,18 @@ def apps_dev_server() -> Iterator[str]:
9393
str(_DEV_PORT),
9494
"--no-reload",
9595
],
96-
env={**os.environ, "FASTMCP_LOG_LEVEL": "WARNING"},
96+
# ``fastmcp dev apps`` unconditionally calls ``webbrowser.open(dev_url)``
97+
# on startup with no flag to disable it. Setting ``BROWSER=true`` makes
98+
# Python's webbrowser module dispatch to the ``true`` command (resolved
99+
# via PATH) — exits 0, opens nothing. Skipped on Windows: there's no
100+
# ``true`` there, and webbrowser would fall through to the default
101+
# browser. The suite is documented as macOS/Linux-only, matching the
102+
# ``start_new_session`` guard below.
103+
env={
104+
**os.environ,
105+
"FASTMCP_LOG_LEVEL": "WARNING",
106+
**({"BROWSER": "true"} if sys.platform != "win32" else {}),
107+
},
97108
stdout=subprocess.DEVNULL,
98109
stderr=subprocess.DEVNULL,
99110
start_new_session=sys.platform != "win32",

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)