From c753da8cc1cad82b75842096c9642fa669f95054 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 24 Apr 2024 21:34:28 -0400 Subject: [PATCH] Fix the test on brew since we could have brew --install call as well --- test/test_install.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/test_install.py b/test/test_install.py index a7d29fb..a53700d 100644 --- a/test/test_install.py +++ b/test/test_install.py @@ -413,7 +413,17 @@ def test_install_git_annex_brew(mocker: MockerFixture) -> None: spy = mocker.spy(datalad_installer, "runcmd") r = main(["datalad_installer.py", "git-annex", "-m", "brew"]) assert r == 0 - assert spy.call_args_list[-1] == mocker.call("brew", "install", "git-annex") + + # where to look for the "brew install" invocation + target_index = -1 + # we might have checked also for the brew --prefix + if spy.call_args_list[-1] == mocker.call( + "brew", "--prefix", stdout=-1, universal_newlines=True + ): + target_index -= 1 + assert spy.call_args_list[target_index] == mocker.call( + "brew", "install", "git-annex" + ) assert shutil.which("git-annex") is not None