Skip to content

fix(tests): platform-safe os.startfile/subprocess.Popen mock - #7

Merged
lukisch merged 1 commit into
masterfrom
fix/T-20260926-startfile-mock-only
Sep 26, 2026
Merged

lukisch merged 1 commit into
masterfrom
fix/T-20260926-startfile-mock-only

Conversation

@lukisch

@lukisch lukisch commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Aufgeteilt aus PR #6 (Team-Lead-Entscheid): merge-reviewer hat gemessen, dass PR#6 unter Windows stabil schlechter war als master (0/9 vs. 6/9 gruen, p≈0,01), zurueckgefuehrt auf den inzwischen revertierten conftest.py-Versuch. Dieser PR enthaelt NUR den unabhaengigen os.startfile/subprocess.Popen-Mock-Fix (behebt einen echten AttributeError-Absturz auf Linux/macOS). 3x CI-Wiederholung folgt, Belege gehen in Ticket T-20260926-987151525.

Split out of PR #6 at team-lead's request (measured Windows regression
there was traced to the conftest.py Qt-teardown attempt, reverted; this
fix is unrelated and independently verified).

test_open_extern_handles_os_error_gracefully patched os.startfile
unconditionally. os.startfile does not exist on Linux/macOS at all, so
unittest.mock.patch() on it raised AttributeError there before the test
body even ran. The test now mocks whichever call _open_extern() actually
uses for the current sys.platform (os.startfile on win32,
subprocess.Popen everywhere else -- matching the source's own branching).
@github-actions

Copy link
Copy Markdown

Welcome! Thanks for your first pull request in this repository.

A maintainer will review it soon. Please make sure:

  • Your changes are tested
  • Documentation is updated if needed
  • The PR description explains what changed and why

Thanks for contributing.

@lukisch

lukisch commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator Author

Review (merge-reviewer, claude-opus) auf Head b73757a: OK. Der win32-Zweig ist nachweislich identisch mit dem alten Patch (patch("os.startfile", side_effect=OSError("No application associated"))), sys war schon importiert. Geändert wird nur Linux/macOS (Mock auf subprocess.Popen). In der CI besteht der startfile-Test jetzt auf allen Linux/macOS-Legs. Die restlichen Fehlschläge dort sind die case-only-Tests auf macOS, die #8 behebt, und der bekannte Teardown-Crash (T-20260926-987151525). Unter Windows gibt es keinen Mechanismus für eine Verschlechterung. Admin-Merge über team-lead.

@lukisch
lukisch merged commit 268bbf6 into master Sep 26, 2026
13 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant