Skip to content

Commit 88046ab

Browse files
committed
test: mark the fake git executable on Unix so shutil.which finds it
1 parent 8ef249d commit 88046ab

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/unit_shim.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def test_install_warns_about_path_shadowing(tmp_path, capsys, monkeypatch):
8080
elsewhere.mkdir()
8181
real_git = elsewhere / _name("git")
8282
real_git.write_bytes(b"# pretend real git\n")
83+
# shutil.which() on Unix only finds executable files.
84+
if os.name != "nt":
85+
real_git.chmod(real_git.stat().st_mode | 0o111)
8386
monkeypatch.setenv("PATH", str(elsewhere) + os.pathsep + str(tmp_path))
8487
rc = cli_run("install-git-shim", "--dir", str(tmp_path))
8588
assert rc == 0

0 commit comments

Comments
 (0)