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