We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa2e154 commit c377830Copy full SHA for c377830
1 file changed
tests/languages/python_test.py
@@ -44,6 +44,12 @@ def test_sys_executable_matches_does_not_match(v):
44
),
45
)
46
def test_find_by_sys_executable(exe, realpath, expected):
47
+ def mocked_find_executable(exe):
48
+ return exe.rpartition('/')[2]
49
with mock.patch.object(sys, 'executable', exe):
50
with mock.patch('os.path.realpath', return_value=realpath):
- assert python._find_by_sys_executable() == expected
51
+ with mock.patch(
52
+ 'pre_commit.parse_shebang.find_executable',
53
+ side_effect=mocked_find_executable,
54
+ ):
55
+ assert python._find_by_sys_executable() == expected
0 commit comments