Add duration to verbose run

This commit is contained in:
Anthony Sottile 2019-12-28 17:58:04 -08:00
parent 1074b39988
commit 0c0427bfbd
7 changed files with 74 additions and 55 deletions

View file

@ -3,6 +3,9 @@ from __future__ import unicode_literals
import os.path
import re
import time
import mock
from pre_commit import git
from pre_commit.commands.try_repo import try_repo
@ -40,7 +43,8 @@ def _run_try_repo(tempdir_factory, **kwargs):
def test_try_repo_repo_only(cap_out, tempdir_factory):
_run_try_repo(tempdir_factory, verbose=True)
with mock.patch.object(time, 'time', return_value=0.0):
_run_try_repo(tempdir_factory, verbose=True)
start, config, rest = _get_out(cap_out)
assert start == ''
assert re.match(
@ -58,6 +62,7 @@ Bash hook............................................(no files to check)Skipped
- hook id: bash_hook
Bash hook................................................................Passed
- hook id: bash_hook2
- duration: 0s
test-file