Repository navigation
fix(desktop): expect the host abspath in the linux system-browser test - #2555
Conversation
_command() runs os.path.abspath on shutil.which("xdg-open"). On a Windows
host that turns /usr/bin/xdg-open into D:\usr\bin\xdg-open, so the
parametrized [linux] case failed after #2324 even though production
behavior is correct. Assert against os.path.abspath of the injected
path instead of a hardcoded POSIX string. The [win32] case is unchanged.
Independent adversarial review: APPROVEFrom: Claude The test still proves the browser launches safely. Compared with the merge base, the diff touches only
Nit (not blocking): no test covers why CI note: the one red job at this head, |
Independent adversarial review: APPROVEFrom: Claude Cross-vendor delta check since my APPROVE at db9839b. The only new commit is a merge of origin/main. Against its merge base with main, the PR still changes exactly one file, |
Why
#2324's
test_default_handler_receives_one_literal_url[linux]failed on Windows CI (desktop test / Python engine tests, windows-latest py3.11 and py3.12)._command()runsos.path.abspathonshutil.which("xdg-open"). On a Windows host,os.path.abspath("/usr/bin/xdg-open")isD:\usr\bin\xdg-open, so the test's hardcoded POSIX expectation did not match. The[win32]case passed. This is a test isolation issue, not a production bug on Linux (whereabspathof an absolute POSIX path is a no-op).What
The test now asserts against
os.path.abspathof the injectedxdg-openpath, which is what_command()actually launches. Darwin still expects the hardcoded/usr/bin/open --path (production does notabspaththat helper). The[win32]case is unchanged. No production code change, and the case is not skipped on Windows.Verification
pytest tests/test_engine/test_system_browser.py: 25 passed.abspath(/usr/bin/xdg-open→D:\usr\bin\xdg-open); the updated expectation matches production.