mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fixing tests to account for the new terminal_supports_color variable
This commit is contained in:
parent
3d777bb386
commit
710eef317a
1 changed files with 9 additions and 2 deletions
|
|
@ -35,9 +35,16 @@ def test_use_color_no_tty():
|
|||
assert use_color('auto') is False
|
||||
|
||||
|
||||
def test_use_color_tty():
|
||||
def test_use_color_tty_with_color_support():
|
||||
with mock.patch.object(sys.stdout, 'isatty', return_value=True):
|
||||
assert use_color('auto') is True
|
||||
with mock.patch('pre_commit.color.terminal_supports_color', True):
|
||||
assert use_color('auto') is True
|
||||
|
||||
|
||||
def test_use_color_tty_without_color_support():
|
||||
with mock.patch.object(sys.stdout, 'isatty', return_value=True):
|
||||
with mock.patch('pre_commit.color.terminal_supports_color', False):
|
||||
assert use_color('auto') is False
|
||||
|
||||
|
||||
def test_use_color_raises_if_given_shenanigans():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue