From df4af6a62b14f3b713cc10a6e1f4069136fc9f2a Mon Sep 17 00:00:00 2001 From: Reilly Brogan Date: Thu, 25 Apr 2024 14:48:23 -0500 Subject: [PATCH] testing: fix a failing test when `TERM=dumb` Dumb terminals are incapable of handling color, so this test would fail when ran in such an environment. --- AUTHORS | 1 + changelog/12244.contrib.rst | 1 + testing/io/test_terminalwriter.py | 1 + 3 files changed, 3 insertions(+) create mode 100644 changelog/12244.contrib.rst diff --git a/AUTHORS b/AUTHORS index 0387a3154b3..9cd26e10fb9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -383,6 +383,7 @@ Reza Mousavi Raquel Alegre Ravi Chandra Reagan Lee +Reilly Brogan Rob Arrow Robert Holt Roberto Aldera diff --git a/changelog/12244.contrib.rst b/changelog/12244.contrib.rst new file mode 100644 index 00000000000..e39dad1cfbf --- /dev/null +++ b/changelog/12244.contrib.rst @@ -0,0 +1 @@ +Fixed self-test failures when `TERM=dumb`. diff --git a/testing/io/test_terminalwriter.py b/testing/io/test_terminalwriter.py index 1f38d6f15d9..9aa89da0e41 100644 --- a/testing/io/test_terminalwriter.py +++ b/testing/io/test_terminalwriter.py @@ -224,6 +224,7 @@ def test_NO_COLOR_and_FORCE_COLOR( def test_empty_NO_COLOR_and_FORCE_COLOR_ignored(monkeypatch: MonkeyPatch) -> None: + monkeypatch.setenv("TERM", "xterm-256color") monkeypatch.setitem(os.environ, "NO_COLOR", "") monkeypatch.setitem(os.environ, "FORCE_COLOR", "") assert_color(True, True)