Fix broken tests when NO_COLOR=1 is set (#943).
All checks were successful
build / test (push) Successful in 4m7s
build / docs (push) Successful in 56s

This commit is contained in:
Dan Helfman 2024-11-19 08:48:21 -08:00
parent 4985b805b4
commit 97305cc3ce

View File

@ -45,11 +45,13 @@ def test_interactive_console_true_when_isatty_and_TERM_is_not_dumb(capsys):
def test_should_do_markup_respects_no_color_value():
flexmock(module.os.environ).should_receive('get').and_return(None)
flexmock(module).should_receive('interactive_console').never()
assert module.should_do_markup(no_color=True, configs={}) is False
def test_should_do_markup_respects_config_value():
flexmock(module.os.environ).should_receive('get').and_return(None)
flexmock(module).should_receive('interactive_console').never()
assert module.should_do_markup(no_color=False, configs={'foo.yaml': {'color': False}}) is False
@ -58,6 +60,7 @@ def test_should_do_markup_respects_config_value():
def test_should_do_markup_prefers_any_false_config_value():
flexmock(module.os.environ).should_receive('get').and_return(None)
flexmock(module).should_receive('interactive_console').never()
assert (
@ -84,6 +87,7 @@ def test_should_do_markup_respects_PY_COLORS_environment_variable():
def test_should_do_markup_prefers_no_color_value_to_config_value():
flexmock(module.os.environ).should_receive('get').and_return(None)
flexmock(module).should_receive('interactive_console').never()
assert module.should_do_markup(no_color=True, configs={'foo.yaml': {'color': True}}) is False