Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1eed1b5

Browse files
committed
Address PR feedback
1 parent 950bc2c commit 1eed1b5

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

pre_commit/languages/golang.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pre_commit.constants as C
88
from pre_commit import git
99
from pre_commit.envcontext import envcontext
10-
from pre_commit.envcontext import UNSET
1110
from pre_commit.envcontext import Var
1211
from pre_commit.languages import helpers
1312
from pre_commit.util import clean_path_on_failure
@@ -22,7 +21,6 @@
2221

2322
def get_env_patch(venv):
2423
return (
25-
('GOBIN', UNSET),
2624
('PATH', (os.path.join(venv, 'bin'), os.pathsep, Var('PATH'))),
2725
)
2826

tests/repository_test.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _test_hook_repo(
7272
path = make_repo(tempdir_factory, repo_path)
7373
config = make_config_from_repo(path, **(config_kwargs or {}))
7474
ret = _get_hook(config, store, hook_id).run(args)
75-
assert ret[0] == expected_return_code, "output was: {}".format(ret[1])
75+
assert ret[0] == expected_return_code
7676
assert _norm_out(ret[1]) == expected
7777

7878

@@ -271,11 +271,8 @@ def test_golang_hook(tempdir_factory, store):
271271
def test_golang_hook_still_works_when_gobin_is_set(tempdir_factory, store):
272272
gobin_dir = tempdir_factory.get()
273273
with envcontext([('GOBIN', gobin_dir)]):
274-
_test_hook_repo(
275-
tempdir_factory, store, 'golang_hooks_repo',
276-
'golang-hook', [], b'hello world\n',
277-
)
278-
assert os.listdir(gobin_dir) == [], "hook must not be installed in $GOBIN"
274+
test_golang_hook(tempdir_factory, store)
275+
assert os.listdir(gobin_dir) == []
279276

280277

281278
def test_rust_hook(tempdir_factory, store):

0 commit comments

Comments
 (0)