File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4363,13 +4363,17 @@ def foo():
43634363 f'{ boldm } ZeroDivisionError{ reset } : { magenta } division by zero{ reset } ' ]
43644364 self .assertEqual (actual , expected )
43654365
4366+ @force_not_colorized
43664367 def test_colorized_detection_checks_for_environment_variables (self ):
43674368 if sys .platform == "win32" :
43684369 virtual_patching = unittest .mock .patch ("nt._supports_virtual_terminal" , return_value = True )
43694370 else :
43704371 virtual_patching = contextlib .nullcontext ()
43714372 with virtual_patching :
4373+
4374+ flags = unittest .mock .MagicMock (ignore_environment = False )
43724375 with (unittest .mock .patch ("os.isatty" ) as isatty_mock ,
4376+ unittest .mock .patch ("sys.flags" , flags ),
43734377 unittest .mock .patch ("traceback._can_colorize" , ORIGINAL_CAN_COLORIZE )):
43744378 isatty_mock .return_value = True
43754379 with unittest .mock .patch ("os.environ" , {'TERM' : 'dumb' }):
You can’t perform that action at this time.
0 commit comments