mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
47d0e05d09
commit
6ce60ed606
2 changed files with 4 additions and 4 deletions
|
|
@ -189,8 +189,8 @@ def _run_single_hook(
|
||||||
if not hook.pass_filenames:
|
if not hook.pass_filenames:
|
||||||
filenames = ()
|
filenames = ()
|
||||||
elif hook.use_filesnames_file:
|
elif hook.use_filesnames_file:
|
||||||
filenames_file = tempfile.NamedTemporaryFile("w+")
|
filenames_file = tempfile.NamedTemporaryFile('w+')
|
||||||
filenames_file.write("\n".join(filenames))
|
filenames_file.write('\n'.join(filenames))
|
||||||
filenames = (f"@{filenames_file}",)
|
filenames = (f"@{filenames_file}",)
|
||||||
|
|
||||||
time_before = time.monotonic()
|
time_before = time.monotonic()
|
||||||
|
|
|
||||||
|
|
@ -1085,8 +1085,8 @@ def test_use_filesnames_file(
|
||||||
cap_out, store, repo_with_passing_hook, run_opts(verbose=True),
|
cap_out, store, repo_with_passing_hook, run_opts(verbose=True),
|
||||||
)
|
)
|
||||||
out_lines = printed.splitlines()
|
out_lines = printed.splitlines()
|
||||||
out_lines[-1] == b"Hello World"
|
out_lines[-1] == b'Hello World'
|
||||||
assert out_lines[-2].startswith(b"@") == use_filesnames_file
|
assert out_lines[-2].startswith(b'@') == use_filesnames_file
|
||||||
|
|
||||||
|
|
||||||
def test_fail_fast(cap_out, store, repo_with_failing_hook):
|
def test_fail_fast(cap_out, store, repo_with_failing_hook):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue