Skip to content

Commit d2fb515

Browse files
committed
Fixed logic
1 parent e3a95ef commit d2fb515

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/tox/config/cli/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ def add_color_flags(parser: ArgumentParser) -> None:
290290
converter = StrConvert()
291291
if converter.to_bool(os.environ.get("NO_COLOR", "")):
292292
color = "no"
293-
elif os.environ.get("TERM", "") == "dumb":
294-
color = "no"
295293
elif converter.to_bool(os.environ.get("FORCE_COLOR", "")):
296294
color = "yes"
295+
elif os.environ.get("TERM", "") == "dumb":
296+
color = "no"
297297
else:
298298
color = "yes" if sys.stdout.isatty() else "no"
299299

tests/config/cli/test_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ def test_parser_color(
5454
stdout_mock = mocker.patch("tox.config.cli.parser.sys.stdout")
5555
stdout_mock.isatty.return_value = is_atty
5656

57-
if term == "dumb":
58-
expected = False
59-
elif tox_color in ("yes", "no"):
57+
if tox_color in ("yes", "no"):
6058
expected = tox_color == "yes"
6159
elif no_color == "1":
6260
expected = False
6361
elif force_color == "1":
6462
expected = True
63+
elif term == "dumb":
64+
expected = False
6565
else:
6666
expected = is_atty
6767

0 commit comments

Comments
 (0)