We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d777bb commit 710eef3Copy full SHA for 710eef3
1 file changed
tests/color_test.py
@@ -35,9 +35,16 @@ def test_use_color_no_tty():
35
assert use_color('auto') is False
36
37
38
-def test_use_color_tty():
+def test_use_color_tty_with_color_support():
39
with mock.patch.object(sys.stdout, 'isatty', return_value=True):
40
- assert use_color('auto') is True
+ with mock.patch('pre_commit.color.terminal_supports_color', True):
41
+ assert use_color('auto') is True
42
+
43
44
+def test_use_color_tty_without_color_support():
45
+ with mock.patch.object(sys.stdout, 'isatty', return_value=True):
46
+ with mock.patch('pre_commit.color.terminal_supports_color', False):
47
+ assert use_color('auto') is False
48
49
50
def test_use_color_raises_if_given_shenanigans():
0 commit comments