mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
Merge pull request #3024 from pre-commit/pick-shebang-path-without-spaces
use sys.executable instead of echo.exe in parse_shebang
This commit is contained in:
commit
676e51aa5e
1 changed files with 6 additions and 6 deletions
|
|
@ -133,17 +133,17 @@ def test_normalize_cmd_PATH():
|
||||||
|
|
||||||
|
|
||||||
def test_normalize_cmd_shebang(in_tmpdir):
|
def test_normalize_cmd_shebang(in_tmpdir):
|
||||||
echo = _echo_exe().replace(os.sep, '/')
|
us = sys.executable.replace(os.sep, '/')
|
||||||
path = write_executable(echo)
|
path = write_executable(us)
|
||||||
assert parse_shebang.normalize_cmd((path,)) == (echo, path)
|
assert parse_shebang.normalize_cmd((path,)) == (us, path)
|
||||||
|
|
||||||
|
|
||||||
def test_normalize_cmd_PATH_shebang_full_path(in_tmpdir):
|
def test_normalize_cmd_PATH_shebang_full_path(in_tmpdir):
|
||||||
echo = _echo_exe().replace(os.sep, '/')
|
us = sys.executable.replace(os.sep, '/')
|
||||||
path = write_executable(echo)
|
path = write_executable(us)
|
||||||
with bin_on_path():
|
with bin_on_path():
|
||||||
ret = parse_shebang.normalize_cmd(('run',))
|
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):
|
def test_normalize_cmd_PATH_shebang_PATH(in_tmpdir):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue