Skip to content

Commit

Permalink
test_run: support spaces in sys.executable path
Browse files Browse the repository at this point in the history
On my Mac, hatch creates its virtual environments in
`$HOME/Library/Application Support`.  So the python3 executable ends up
at a path with a space in it.

The space in the path caused `test_run()` to fail, because without
quotes the first `utis.run()` call would try and execute
`$HOME/Library/Application` (up to the space) instead of the python3
executable.
  • Loading branch information
tomjakubowski committed Oct 24, 2024
1 parent 445ceab commit 108f163
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_ensure_targets(tmp_path):


def test_run():
cmd = f"{sys.executable} --version"
cmd = f"{shlex.quote(sys.executable)} --version"
utils.run(cmd)
utils.run(shlex.split(cmd))

Expand Down

0 comments on commit 108f163

Please sign in to comment.