mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
Improve hook duration timing
This commit is contained in:
parent
ac42dc586a
commit
d988767b41
3 changed files with 4 additions and 4 deletions
|
|
@ -293,7 +293,7 @@ def test_verbose_duration(cap_out, store, in_git_dir, t1, t2, expected):
|
|||
write_config('.', {'repo': 'meta', 'hooks': [{'id': 'identity'}]})
|
||||
cmd_output('git', 'add', '.')
|
||||
opts = run_opts(verbose=True)
|
||||
with mock.patch.object(time, 'time', side_effect=(t1, t2)):
|
||||
with mock.patch.object(time, 'monotonic', side_effect=(t1, t2)):
|
||||
ret, printed = _do_run(cap_out, store, str(in_git_dir), opts)
|
||||
assert ret == 0
|
||||
assert expected in printed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue