@@ -36,24 +36,30 @@ def test_use_color_no_tty():
3636
3737
3838def test_use_color_tty_with_color_support ():
39- with mock .patch .object (sys .stderr , 'isatty' , return_value = True ):
40- with mock .patch ('pre_commit.color.terminal_supports_color' , True ):
41- with envcontext .envcontext ((('TERM' , envcontext .UNSET ),)):
42- assert use_color ('auto' ) is True
39+ with (
40+ mock .patch .object (sys .stderr , 'isatty' , return_value = True ),
41+ mock .patch ('pre_commit.color.terminal_supports_color' , True ),
42+ envcontext .envcontext ((('TERM' , envcontext .UNSET ),)),
43+ ):
44+ assert use_color ('auto' ) is True
4345
4446
4547def test_use_color_tty_without_color_support ():
46- with mock .patch .object (sys .stderr , 'isatty' , return_value = True ):
47- with mock .patch ('pre_commit.color.terminal_supports_color' , False ):
48- with envcontext .envcontext ((('TERM' , envcontext .UNSET ),)):
49- assert use_color ('auto' ) is False
48+ with (
49+ mock .patch .object (sys .stderr , 'isatty' , return_value = True ),
50+ mock .patch ('pre_commit.color.terminal_supports_color' , False ),
51+ envcontext .envcontext ((('TERM' , envcontext .UNSET ),)),
52+ ):
53+ assert use_color ('auto' ) is False
5054
5155
5256def test_use_color_dumb_term ():
53- with mock .patch .object (sys .stderr , 'isatty' , return_value = True ):
54- with mock .patch ('pre_commit.color.terminal_supports_color' , True ):
55- with envcontext .envcontext ((('TERM' , 'dumb' ),)):
56- assert use_color ('auto' ) is False
57+ with (
58+ mock .patch .object (sys .stderr , 'isatty' , return_value = True ),
59+ mock .patch ('pre_commit.color.terminal_supports_color' , True ),
60+ envcontext .envcontext ((('TERM' , 'dumb' ),)),
61+ ):
62+ assert use_color ('auto' ) is False
5763
5864
5965def test_use_color_raises_if_given_shenanigans ():
0 commit comments