Skip to content

Commit 40b7114

Browse files
committed
Fixed test_empty_NO_COLOR_and_FORCE_COLOR_ignored when TERM=dumb
Dumb terminals are incapable of handling color, so this test would fail when ran in such an environment
1 parent fafab1d commit 40b7114

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ Rafal Semik
339339
Raquel Alegre
340340
Ravi Chandra
341341
Reagan Lee
342+
Reilly Brogan
342343
Robert Holt
343344
Roberto Aldera
344345
Roberto Polli

testing/io/test_terminalwriter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ def test_NO_COLOR_and_FORCE_COLOR(
221221
monkeypatch.setitem(os.environ, "FORCE_COLOR", FORCE_COLOR)
222222
assert_color(expected)
223223

224-
224+
@pytest.mark.skipif(
225+
os.environ["TERM"] == "dumb" or "NO_COLOR" in os.environ,
226+
reason="dumb terminals can't handle color"
227+
)
225228
def test_empty_NO_COLOR_and_FORCE_COLOR_ignored(monkeypatch: MonkeyPatch) -> None:
226229
monkeypatch.setitem(os.environ, "NO_COLOR", "")
227230
monkeypatch.setitem(os.environ, "FORCE_COLOR", "")

0 commit comments

Comments
 (0)