Skip to content

Commit

Permalink
Merge pull request #3024 from pre-commit/pick-shebang-path-without-sp…
Browse files Browse the repository at this point in the history
…aces

use sys.executable instead of echo.exe in parse_shebang
  • Loading branch information
asottile committed Oct 9, 2023
2 parents 19aa121 + 997ea0a commit 676e51a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/parse_shebang_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ def test_normalize_cmd_PATH():


def test_normalize_cmd_shebang(in_tmpdir):
echo = _echo_exe().replace(os.sep, '/')
path = write_executable(echo)
assert parse_shebang.normalize_cmd((path,)) == (echo, path)
us = sys.executable.replace(os.sep, '/')
path = write_executable(us)
assert parse_shebang.normalize_cmd((path,)) == (us, path)


def test_normalize_cmd_PATH_shebang_full_path(in_tmpdir):
echo = _echo_exe().replace(os.sep, '/')
path = write_executable(echo)
us = sys.executable.replace(os.sep, '/')
path = write_executable(us)
with bin_on_path():
ret = parse_shebang.normalize_cmd(('run',))
assert ret == (echo, os.path.abspath(path))
assert ret == (us, os.path.abspath(path))


def test_normalize_cmd_PATH_shebang_PATH(in_tmpdir):
Expand Down

0 comments on commit 676e51a

Please sign in to comment.