mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Use 80 or min width instead of terminal size
This commit is contained in:
parent
0a810249e3
commit
a677c42e21
4 changed files with 63 additions and 31 deletions
|
|
@ -13,6 +13,7 @@ import pytest
|
|||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit.commands.install_uninstall import install
|
||||
from pre_commit.commands.run import _compute_cols
|
||||
from pre_commit.commands.run import _get_skips
|
||||
from pre_commit.commands.run import _has_unmerged_paths
|
||||
from pre_commit.commands.run import get_changed_files
|
||||
|
|
@ -279,6 +280,23 @@ def test_merge_conflict_resolved(in_merge_conflict, mock_out_store_directory):
|
|||
assert msg in printed
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('hooks', 'verbose', 'expected'),
|
||||
(
|
||||
([], True, 80),
|
||||
([{'id': 'a', 'name': 'a' * 51}], False, 81),
|
||||
([{'id': 'a', 'name': 'a' * 51}], True, 85),
|
||||
(
|
||||
[{'id': 'a', 'name': 'a' * 51}, {'id': 'b', 'name': 'b' * 52}],
|
||||
False,
|
||||
82,
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_compute_cols(hooks, verbose, expected):
|
||||
assert _compute_cols(hooks, verbose) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('environ', 'expected_output'),
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue