Skip to content

fix: Isolate tests from the calling git process's environment - #24

Merged
shackmann merged 1 commit into
mainfrom
stefan/leak-test-fix
Oct 16, 2026
Merged

shackmann merged 1 commit into
mainfrom
stefan/leak-test-fix

Conversation

@shackmann

@shackmann shackmann commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Test-only harness change with no impact on production code or runtime behavior outside the test suite.

Overview
Prevents flaky or destructive test behavior when pytest runs under a git hook (e.g. git commit -a) that exports variables like GIT_INDEX_FILE pointing at this repo’s index instead of a temp repo.

pytest_configure in tests/conftest.py now deletes every GIT_* environment variable before fixtures or xdist workers start. A new test in tests/test_git_environment.py asserts the process sees no GIT_* vars, guarding that isolation.

Reviewed by Cursor Bugbot for commit a89eb50. Configure here.

@shackmann
shackmann merged commit da21b0e into main Oct 16, 2026
3 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