Python SDK browser tests use POSIX-only path assertions on Windows
Description
Two Python SDK browser tests make POSIX-only string assertions and fail on Windows even though the browser code returns valid native paths.
One assertion expects Path("/tmp/downloads") to stringify with forward slashes. Another checks an extension directory using forward-slash suffixes. On Windows, Python correctly produces backslash-separated paths, so the focused browser test module cannot pass.
Code reference
packages/sdk-python/tests/test_browser.py:339-356passesPath("/tmp/downloads")and asserts the captured string is exactly"/tmp/downloads".packages/sdk-python/tests/test_browser.py:437-448asserts that the extension directory ends with either"stagehand/_extension"or"extension/dist".packages/sdk-python/src/stagehand/browser.py:411intentionally converts the caller'sPathwithstr().packages/sdk-python/src/stagehand/browser.py:438similarly forwards the packaged extension path as a native string.
Reproduction
On Windows 11 with Python 3.11+:
uv run --project packages/sdk-python pytest packages/sdk-python/tests/test_browser.pyThe module reports two failures:
test_launch_configures_downloads_on_the_root_session- expected:
/tmp/downloads - actual:
\tmp\downloads
- expected:
test_connect_uses_extension_id_or_packaged_extension_and_never_owns_source- the native path ends in
stagehand\_extensionorextension\dist, so neither forward-slash suffix matches.
- the native path ends in
The rest of the Python suite completes with 455 passed and 2 skipped in the same environment; these two assertions are the deterministic failures.
Expected behavior
The tests should compare paths semantically (for example with Path components or normalized separators) and pass on supported desktop platforms.
Actual behavior
Valid native Windows paths fail hard-coded POSIX string comparisons, making the Python SDK test suite red for Windows contributors.
Why it matters
The repository contains active Windows-specific fixes and local-browser support. Deterministic platform-only failures hide real regressions and prevent contributors from using the documented test gate reliably.
Duplicate/history check
I searched open and closed issues and PRs for the two test names, downloads_path on Windows, extension-directory path assertions, and Python path separators. Existing Windows work covers other launcher, CLI, and cleanup problems; I found no report or fix for these two v4 Python assertions.
Source: browserbase/stagehand