mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-14 17:41:45 +04:00
Wire in color for pre-commit. Closes #63.
This commit is contained in:
parent
8aa88c7363
commit
73e0111e38
3 changed files with 20 additions and 6 deletions
|
|
@ -5,6 +5,7 @@ import sys
|
|||
|
||||
from pre_commit.color import format_color
|
||||
from pre_commit.color import GREEN
|
||||
from pre_commit.color import InvalidColorSetting
|
||||
from pre_commit.color import use_color
|
||||
|
||||
|
||||
|
|
@ -33,3 +34,8 @@ def test_use_color_no_tty():
|
|||
def test_use_color_tty():
|
||||
with mock.patch.object(sys.stdout, 'isatty', return_value=True):
|
||||
assert use_color('auto') is True
|
||||
|
||||
|
||||
def test_use_color_raises_if_given_shenanigans():
|
||||
with pytest.raises(InvalidColorSetting):
|
||||
use_color('herpaderp')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue