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
This commit is contained in:
Reilly Brogan 2024-04-25 14:48:23 -05:00
parent fafab1dbfd
commit 7eebd11a28
No known key found for this signature in database
GPG Key ID: F58C404158883626
3 changed files with 6 additions and 1 deletions

View File

@ -339,6 +339,7 @@ Rafal Semik
Raquel Alegre
Ravi Chandra
Reagan Lee
Reilly Brogan
Robert Holt
Roberto Aldera
Roberto Polli

View File

@ -0,0 +1 @@
Fixed a test failure with `test_empty_NO_COLOR_and_FORCE_COLOR_ignored` when `TERM=dumb`

View File

@ -221,7 +221,10 @@ def test_NO_COLOR_and_FORCE_COLOR(
monkeypatch.setitem(os.environ, "FORCE_COLOR", FORCE_COLOR)
assert_color(expected)
@pytest.mark.skipif(
os.environ["TERM"] == "dumb" or "NO_COLOR" in os.environ,
reason="dumb terminals can't handle color"
)
def test_empty_NO_COLOR_and_FORCE_COLOR_ignored(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setitem(os.environ, "NO_COLOR", "")
monkeypatch.setitem(os.environ, "FORCE_COLOR", "")