Skip to content

Commit 34ce910

Browse files
committed
test(update): isolate ambient Homebrew guards in upgrade env test
CI runners export HOMEBREW_NO_AUTO_UPDATE (and sometimes HOMEBREW_NO_INSTALL_CLEANUP), which leaked into the inherited subprocess env and made the non-brew assertions fail. Clear them up front so the test asserts the guard delta the code adds, not ambient state.
1 parent f1ee59e commit 34ce910

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/ui_and_conv/test_shell_update.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,12 @@ def test_run_upgrade_command_guards_homebrew_self_upgrade(monkeypatch):
767767
# A brew self-upgrade must not let brew clean up the in-use Cellar version
768768
# mid-session (it would crash the live session), and should skip the redundant
769769
# implicit auto-update. Non-brew upgrades are left untouched.
770+
# Isolate from the ambient environment: CI runners (and some dev machines)
771+
# already export these Homebrew guards, which would otherwise leak into the
772+
# inherited env and mask whether the code adds them only for brew.
773+
monkeypatch.delenv("HOMEBREW_NO_INSTALL_CLEANUP", raising=False)
774+
monkeypatch.delenv("HOMEBREW_NO_AUTO_UPDATE", raising=False)
775+
770776
captured: dict[str, dict[str, str]] = {}
771777

772778
class FakeProc:

0 commit comments

Comments
 (0)