Skip to content

Commit 38da98d

Browse files
committed
Address @asottile's review comments
1 parent c377830 commit 38da98d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pre_commit/languages/python.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def _norm(path):
6666

6767

6868
def _get_default_version(): # pragma: no cover (platform dependent)
69-
7069
# First attempt from `sys.executable` (or the realpath)
7170
exe = _find_by_sys_executable()
7271

tests/languages/python_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import mock
88
import pytest
99

10+
import pre_commit.parse_shebang
1011
from pre_commit.languages import python
1112

1213

@@ -35,7 +36,7 @@ def test_sys_executable_matches_does_not_match(v):
3536

3637

3738
@pytest.mark.parametrize(
38-
'exe,realpath,expected', (
39+
('exe', 'realpath', 'expected'), (
3940
('/usr/bin/python3', '/usr/bin/python3.7', 'python3'),
4041
('/usr/bin/python', '/usr/bin/python3.7', 'python3.7'),
4142
('/usr/bin/python', '/usr/bin/python', None),
@@ -47,9 +48,9 @@ def test_find_by_sys_executable(exe, realpath, expected):
4748
def mocked_find_executable(exe):
4849
return exe.rpartition('/')[2]
4950
with mock.patch.object(sys, 'executable', exe):
50-
with mock.patch('os.path.realpath', return_value=realpath):
51-
with mock.patch(
52-
'pre_commit.parse_shebang.find_executable',
51+
with mock.patch.object(os.path, 'realpath', return_value=realpath):
52+
with mock.patch.object(
53+
pre_commit.parse_shebang, 'find_executable',
5354
side_effect=mocked_find_executable,
5455
):
5556
assert python._find_by_sys_executable() == expected

0 commit comments

Comments
 (0)