Skip to content

Commit f241808

Browse files
committed
Simplify test of refresh that should succeed
shutil.which does not always find the git that Popen would run, at least on Windows, but it is no worse than running a "command -v" or "where" command as was previously done here via os.popen.
1 parent ba4cbae commit f241808

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: test/test_git.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ def test_refresh_bad_git_path(self):
310310
self.assertRaises(GitCommandNotFound, refresh, "yada")
311311

312312
def test_refresh_good_git_path(self):
313-
which_cmd = "where" if os.name == "nt" else "command -v"
314-
path = os.popen("{0} git".format(which_cmd)).read().strip().split("\n")[0]
313+
path = shutil.which("git")
315314
refresh(path)
316315

317316
def test_options_are_passed_to_git(self):

0 commit comments

Comments
 (0)