mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Make autoupdate --tags-only the default, add --bleeding-edge
This commit is contained in:
parent
1be4e4f82e
commit
918179849d
4 changed files with 28 additions and 12 deletions
|
|
@ -186,3 +186,12 @@ def cap_out():
|
|||
with mock.patch.object(output, 'write', write):
|
||||
with mock.patch.object(output, 'write_line', write_line):
|
||||
yield Fixture(stream)
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def fake_log_handler():
|
||||
handler = mock.Mock(level=logging.INFO)
|
||||
logger = logging.getLogger('pre_commit')
|
||||
logger.addHandler(handler)
|
||||
yield handler
|
||||
logger.removeHandler(handler)
|
||||
|
|
|
|||
|
|
@ -127,3 +127,8 @@ def test_expected_fatal_error_no_git_repo(
|
|||
'Is it installed, and are you in a Git repository directory?\n'
|
||||
'Check the log at ~/.pre-commit/pre-commit.log\n'
|
||||
)
|
||||
|
||||
|
||||
def test_warning_on_tags_only(mock_commands, cap_out):
|
||||
main.main(('autoupdate', '--tags-only'))
|
||||
assert '--tags-only is the default' in cap_out.get()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ from __future__ import absolute_import
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import logging
|
||||
import os.path
|
||||
import re
|
||||
import shutil
|
||||
|
|
@ -680,15 +679,6 @@ def test_local_python_repo(store):
|
|||
assert ret[1].replace(b'\r\n', b'\n') == b"['filename']\nHello World\n"
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def fake_log_handler():
|
||||
handler = mock.Mock(level=logging.INFO)
|
||||
logger = logging.getLogger('pre_commit')
|
||||
logger.addHandler(handler)
|
||||
yield handler
|
||||
logger.removeHandler(handler)
|
||||
|
||||
|
||||
def test_hook_id_not_present(tempdir_factory, store, fake_log_handler):
|
||||
path = make_repo(tempdir_factory, 'script_hooks_repo')
|
||||
config = make_config_from_repo(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue