55from pre_commit .clientlib .validate_config import CONFIG_JSON_SCHEMA
66from pre_commit .clientlib .validate_config import validate_config_extra
77from pre_commit .jsonschema_extensions import apply_defaults
8- from pre_commit .prefixed_command_runner import PrefixedCommandRunner
98from pre_commit .repository import Repository
109
1110
1211@pytest .mark .integration
1312def test_install_python_repo_in_env (config_for_python_hooks_repo , store ):
1413 repo = Repository .create (config_for_python_hooks_repo , store )
15- repo .install (PrefixedCommandRunner ( store . directory ) )
14+ repo .install ()
1615 assert os .path .exists (os .path .join (store .directory , repo .sha , 'py_env' ))
1716
1817
1918@pytest .mark .integration
2019def test_run_a_python_hook (config_for_python_hooks_repo , store ):
2120 repo = Repository .create (config_for_python_hooks_repo , store )
22- ret = repo .run_hook (
23- PrefixedCommandRunner (store .directory ), 'foo' , ['/dev/null' ],
24- )
21+ ret = repo .run_hook ('foo' , ['/dev/null' ])
2522
2623 assert ret [0 ] == 0
2724 assert ret [1 ] == "['/dev/null']\n Hello World\n "
@@ -30,9 +27,7 @@ def test_run_a_python_hook(config_for_python_hooks_repo, store):
3027@pytest .mark .integration
3128def test_lots_of_files (config_for_python_hooks_repo , store ):
3229 repo = Repository .create (config_for_python_hooks_repo , store )
33- ret = repo .run_hook (
34- PrefixedCommandRunner (store .directory ), 'foo' , ['/dev/null' ] * 15000 ,
35- )
30+ ret = repo .run_hook ('foo' , ['/dev/null' ] * 15000 )
3631
3732 assert ret [0 ] == 0
3833
@@ -41,9 +36,7 @@ def test_lots_of_files(config_for_python_hooks_repo, store):
4136def test_cwd_of_hook (config_for_prints_cwd_repo , store ):
4237 # Note: this doubles as a test for `system` hooks
4338 repo = Repository .create (config_for_prints_cwd_repo , store )
44- ret = repo .run_hook (
45- PrefixedCommandRunner (store .directory ), 'prints_cwd' , [],
46- )
39+ ret = repo .run_hook ('prints_cwd' , [])
4740
4841 assert ret [0 ] == 0
4942 assert ret [1 ] == repo .repo_url + '\n '
@@ -56,7 +49,7 @@ def test_cwd_of_hook(config_for_prints_cwd_repo, store):
5649@pytest .mark .integration
5750def test_run_a_node_hook (config_for_node_hooks_repo , store ):
5851 repo = Repository .create (config_for_node_hooks_repo , store )
59- ret = repo .run_hook (PrefixedCommandRunner ( store . directory ), 'foo' , [])
52+ ret = repo .run_hook ('foo' , [])
6053
6154 assert ret [0 ] == 0
6255 assert ret [1 ] == 'Hello World\n '
@@ -65,9 +58,7 @@ def test_run_a_node_hook(config_for_node_hooks_repo, store):
6558@pytest .mark .integration
6659def test_run_a_script_hook (config_for_script_hooks_repo , store ):
6760 repo = Repository .create (config_for_script_hooks_repo , store )
68- ret = repo .run_hook (
69- PrefixedCommandRunner (store .directory ), 'bash_hook' , ['bar' ],
70- )
61+ ret = repo .run_hook ('bash_hook' , ['bar' ])
7162
7263 assert ret [0 ] == 0
7364 assert ret [1 ] == 'bar\n Hello World\n '
@@ -106,14 +97,14 @@ def test_languages(config_for_python_hooks_repo, store):
10697
10798def test_reinstall (config_for_python_hooks_repo , store ):
10899 repo = Repository .create (config_for_python_hooks_repo , store )
109- repo .require_installed (PrefixedCommandRunner ( store . directory ) )
100+ repo .require_installed ()
110101 # Reinstall with same repo should not trigger another install
111102 # TODO: how to assert this?
112- repo .require_installed (PrefixedCommandRunner ( store . directory ) )
103+ repo .require_installed ()
113104 # Reinstall on another run should not trigger another install
114105 # TODO: how to assert this?
115106 repo = Repository .create (config_for_python_hooks_repo , store )
116- repo .require_installed (PrefixedCommandRunner ( store . directory ) )
107+ repo .require_installed ()
117108
118109
119110@pytest .mark .integration
@@ -122,4 +113,4 @@ def test_really_long_file_paths(config_for_python_hooks_repo, store):
122113 local ['git' ]['init' , path ]()
123114 with local .cwd (path ):
124115 repo = Repository .create (config_for_python_hooks_repo , store )
125- repo .require_installed (PrefixedCommandRunner ( store . directory ) )
116+ repo .require_installed ()
0 commit comments