Skip to content

fix: serialize testing.invoke cwd handling - #14

Merged
codeforester merged 1 commit into
mainfrom
bug/11-20260730-invoke-cwd-thread-safety
Jul 30, 2026
Merged

fix: serialize testing.invoke cwd handling#14
codeforester merged 1 commit into
mainfrom
bug/11-20260730-invoke-cwd-thread-safety

Conversation

@codeforester

Copy link
Copy Markdown
Contributor

Fixes #11

Summary

  • serialize testing.invoke(cwd=...) calls while the process cwd is temporarily changed
  • preserve cwd restoration around successful and failing invocations
  • add concurrent regression coverage
  • document the process-global cwd contract and limitation

Root cause

The helper uses os.chdir() so relative file I/O sees the requested fixture directory. Because cwd is process-global, concurrent helper calls could race without serialization.

Checks

  • python -m pytest tests/test_testing.py
  • python -m pytest — 154 passed, 4 subtests passed
  • ./tests/validate.sh

@codeforester
codeforester marked this pull request as ready for review July 30, 2026 20:23
@codeforester
codeforester merged commit e70f2ee into main Jul 30, 2026
11 checks passed
@codeforester
codeforester deleted the bug/11-20260730-invoke-cwd-thread-safety branch July 30, 2026 20:23
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.

Serialize testing.invoke cwd handling and document its process-global contract

1 participant