From a12f25d7d753d6edc246d88f43023344efba14b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 31 Dec 2022 08:07:51 +0100 Subject: [PATCH] tests: Use `command -v` instead of third-party `which` program Use `command -v` to locate the git executable instead of `which`. The former is guaranteed to always be available according to POSIX, while which(1) is a redundant third-party tool that is slowly being phased out from Linux distributions. In particular, Gentoo no longer installs it by default. --- test/test_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_git.py b/test/test_git.py index e7d236deb..c5d871f08 100644 --- a/test/test_git.py +++ b/test/test_git.py @@ -169,7 +169,7 @@ def test_refresh(self): self.assertRaises(GitCommandNotFound, refresh, "yada") # test a good path refresh - which_cmd = "where" if is_win else "which" + which_cmd = "where" if is_win else "command -v" path = os.popen("{0} git".format(which_cmd)).read().strip().split("\n")[0] refresh(path)