summaryrefslogtreecommitdiff
path: root/tests/test_utils
diff options
context:
space:
mode:
authorPete Rosenblum <prosenbl@gmail.com>2026-02-25 23:55:18 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-26 08:27:33 -0500
commit71d1e92e11093feb9a337f6d77078c5e75cbb92f (patch)
treebca2bd4dff471022d36e1a1721326544dd0cb234 /tests/test_utils
parente6108b7388775f4996a5906e0525fbdd40d2df51 (diff)
Refs #36936 - Adjusted tests to set PYTHON_COLORS environment variable.
When "FORCE_COLOR" was set in the environment (such as in django-docker-box) several test cases that rely on string comparisons against exception messages or command line results would fail due to ANSI escape sequences being present in the output. This change resolved the issue by setting the "PYTHON_COLORS" environment variable to "0" for those specific tests, which takes precendence over the presence of "FORCE_COLOR".
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/test_simpletestcase.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_utils/test_simpletestcase.py b/tests/test_utils/test_simpletestcase.py
index c6aa314944..c09c68db0c 100644
--- a/tests/test_utils/test_simpletestcase.py
+++ b/tests/test_utils/test_simpletestcase.py
@@ -1,3 +1,4 @@
+import os
import unittest
from io import StringIO
from unittest import mock
@@ -19,6 +20,7 @@ class ErrorTestCase(SimpleTestCase):
pass
+@mock.patch.dict(os.environ, {"PYTHON_COLORS": "0"})
@mock.patch.object(ErrorTestCase, "_post_teardown")
@mock.patch.object(ErrorTestCase, "_pre_setup")
class DebugInvocationTests(SimpleTestCase):