Beispiel #1
0
 def test_supports_color_false_if_no_conditions_are_met(self, mock_isatty):
     assert not supports_color()
Beispiel #2
0
 def test_supports_color_true_if_colorterm_is_in_env(self, mock_isatty):
     os.environ['COLORTERM'] = 'True'
     assert supports_color()
Beispiel #3
0
 def check_color_with_env(self, mock_isatty, term):
     os.environ['TERM'] = term
     assert supports_color()
Beispiel #4
0
 def test_supports_color_true_if_color_flag_is_used(self, mock_isatty):
     sys.argv = ['--color']
     assert supports_color()
Beispiel #5
0
 def test_supports_color_false_if_term_is_dumb(self, mock_isatty):
     os.environ['TERM'] = 'dumb'
     assert not supports_color()
Beispiel #6
0
 def test_supports_color_false_if_no_color_flag_is_used(self, mock_isatty):
     sys.argv = ['--no-color']
     assert not supports_color()
Beispiel #7
0
 def test_supports_color_true_if_platform_is_win32(self, mock_isatty):
     sys.platform = 'win32'
     assert supports_color()
Beispiel #8
0
 def test_supports_color_false_if_no_conditions_are_met(self, mock_isatty):
     assert not supports_color()
Beispiel #9
0
 def test_supports_color_false_if_not_tty(self, mock_isatty):
     assert not supports_color()
Beispiel #10
0
 def test_supports_color_true_if_colorterm_is_in_env(self, mock_isatty):
     os.environ['COLORTERM'] = 'True'
     assert supports_color()
Beispiel #11
0
 def check_color_with_env(self, mock_isatty, term):
     os.environ['TERM'] = term
     assert supports_color()
Beispiel #12
0
 def test_supports_color_false_if_term_is_dumb(self, mock_isatty):
     os.environ['TERM'] = 'dumb'
     assert not supports_color()
Beispiel #13
0
 def test_supports_color_true_if_color_flag_is_used(self, mock_isatty):
     sys.argv = ['--color']
     assert supports_color()
Beispiel #14
0
 def test_supports_color_true_if_platform_is_win32(self, mock_isatty):
     sys.platform = 'win32'
     assert supports_color()
Beispiel #15
0
 def test_supports_color_false_if_no_color_flag_is_used(self, mock_isatty):
     sys.argv = ['--no-color']
     assert not supports_color()
Beispiel #16
0
 def test_supports_color_false_if_not_tty(self, mock_isatty):
     assert not supports_color()