@@ -31,7 +31,9 @@ def test_install_pre_commit(empty_git_dir):
3131 assert ret == 0
3232 assert os .path .exists (runner .pre_commit_path )
3333 pre_commit_contents = open (runner .pre_commit_path ).read ()
34- pre_commit_sh = pkg_resources .resource_filename ('pre_commit' , 'resources/pre-commit.sh' )
34+ pre_commit_sh = pkg_resources .resource_filename (
35+ 'pre_commit' , 'resources/pre-commit.sh' ,
36+ )
3537 expected_contents = open (pre_commit_sh ).read ()
3638 assert pre_commit_contents == expected_contents
3739 stat_result = os .stat (runner .pre_commit_path )
@@ -132,7 +134,9 @@ def test_removes_defaults(out_of_date_repo, runner_with_mocked_store):
132134 assert 'expected_return_value' not in ret ['hooks' ][0 ]
133135
134136
135- def test_autoupdate_out_of_date_repo (out_of_date_repo , mock_out_store_directory ):
137+ def test_autoupdate_out_of_date_repo (
138+ out_of_date_repo , mock_out_store_directory
139+ ):
136140 before = open (C .CONFIG_FILE ).read ()
137141 runner = Runner (out_of_date_repo .python_hooks_repo )
138142 ret = commands .autoupdate (runner )
@@ -152,7 +156,10 @@ def hook_disappearing_repo(python_hooks_repo):
152156 config_wrapped = apply_defaults ([config ], CONFIG_JSON_SCHEMA )
153157 validate_config_extra (config_wrapped )
154158 config = config_wrapped [0 ]
155- shutil .copy (get_resource_path ('manifest_without_foo.yaml' ), C .MANIFEST_FILE )
159+ shutil .copy (
160+ get_resource_path ('manifest_without_foo.yaml' ),
161+ C .MANIFEST_FILE ,
162+ )
156163 local ['git' ]['add' , '.' ]()
157164 local ['git' ]['commit' , '-m' , 'Remove foo' ]()
158165
@@ -167,14 +174,18 @@ def hook_disappearing_repo(python_hooks_repo):
167174 )
168175
169176
170- def test_hook_disppearing_repo_raises (hook_disappearing_repo , runner_with_mocked_store ):
177+ def test_hook_disppearing_repo_raises (
178+ hook_disappearing_repo , runner_with_mocked_store
179+ ):
171180 with pytest .raises (commands .RepositoryCannotBeUpdatedError ):
172181 commands ._update_repository (
173182 hook_disappearing_repo .repo_config , runner_with_mocked_store ,
174183 )
175184
176185
177- def test_autoupdate_hook_disappearing_repo (hook_disappearing_repo , mock_out_store_directory ):
186+ def test_autoupdate_hook_disappearing_repo (
187+ hook_disappearing_repo , mock_out_store_directory
188+ ):
178189 before = open (C .CONFIG_FILE ).read ()
179190 runner = Runner (hook_disappearing_repo .python_hooks_repo )
180191 ret = commands .autoupdate (runner )
@@ -206,7 +217,13 @@ def get_write_mock_output(write_mock):
206217 return '' .join (call [0 ][0 ] for call in write_mock .call_args_list )
207218
208219
209- def _get_opts (all_files = False , color = False , verbose = False , hook = None , no_stash = False ):
220+ def _get_opts (
221+ all_files = False ,
222+ color = False ,
223+ verbose = False ,
224+ hook = None ,
225+ no_stash = False ,
226+ ):
210227 return auto_namedtuple (
211228 all_files = all_files ,
212229 color = color ,
@@ -234,7 +251,9 @@ def _test_run(repo, options, expected_outputs, expected_ret, stage):
234251 assert expected_output_part in printed
235252
236253
237- def test_run_all_hooks_failing (repo_with_failing_hook , mock_out_store_directory ):
254+ def test_run_all_hooks_failing (
255+ repo_with_failing_hook , mock_out_store_directory
256+ ):
238257 _test_run (
239258 repo_with_failing_hook ,
240259 {},
@@ -262,7 +281,14 @@ def test_run_all_hooks_failing(repo_with_failing_hook, mock_out_store_directory)
262281 ({}, ('Bash hook' , '(no files to check)' , 'Skipped' ), 0 , False ),
263282 )
264283)
265- def test_run (repo_with_passing_hook , options , outputs , expected_ret , stage , mock_out_store_directory ):
284+ def test_run (
285+ repo_with_passing_hook ,
286+ options ,
287+ outputs ,
288+ expected_ret ,
289+ stage ,
290+ mock_out_store_directory ,
291+ ):
266292 _test_run (repo_with_passing_hook , options , outputs , expected_ret , stage )
267293
268294
@@ -275,7 +301,13 @@ def test_run(repo_with_passing_hook, options, outputs, expected_ret, stage, mock
275301 (False , False , True ),
276302 ),
277303)
278- def test_no_stash (repo_with_passing_hook , no_stash , all_files , expect_stash , mock_out_store_directory ):
304+ def test_no_stash (
305+ repo_with_passing_hook ,
306+ no_stash ,
307+ all_files ,
308+ expect_stash ,
309+ mock_out_store_directory ,
310+ ):
279311 stage_a_file ()
280312 # Make unstaged changes
281313 with open ('foo.py' , 'w' ) as foo_file :
@@ -347,11 +379,15 @@ def test_skip_hook(repo_with_passing_hook, mock_out_store_directory):
347379 assert msg in printed
348380
349381
350- def test_hook_id_not_in_non_verbose_output (repo_with_passing_hook , mock_out_store_directory ):
382+ def test_hook_id_not_in_non_verbose_output (
383+ repo_with_passing_hook , mock_out_store_directory
384+ ):
351385 ret , printed = _do_run (repo_with_passing_hook , _get_opts (verbose = False ))
352386 assert '[bash_hook]' not in printed
353387
354388
355- def test_hook_id_in_verbose_output (repo_with_passing_hook , mock_out_store_directory ):
389+ def test_hook_id_in_verbose_output (
390+ repo_with_passing_hook , mock_out_store_directory
391+ ):
356392 ret , printed = _do_run (repo_with_passing_hook , _get_opts (verbose = True ))
357393 assert '[bash_hook] Bash hook' in printed
0 commit comments