Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,16 @@ def test_fish_activate_shadowed_builtins(self):
shadows one of those builtins (a common pattern for `.`-style directory
navigators) must not hijack the prompt or break status restoration.
"""
fish = shutil.which('fish')
if fish is None:
# Some systems have an unrelated "fish" game (see fish(6)), which
# can precede the fish shell in PATH.
for dirname in None, *os.get_exec_path():
fish = shutil.which('fish', path=dirname)
if fish is not None and subprocess.run(
[fish, '-c', 'echo $FISH_VERSION'],
stdin=subprocess.DEVNULL,
capture_output=True).stdout.strip():
break
else:
self.skipTest('fish required for this test')
rmtree(self.env_dir)
builder = venv.EnvBuilder(clear=True)
Expand Down
Loading