diff options
| author | Pete Rosenblum <prosenbl@gmail.com> | 2026-02-25 23:55:18 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-02-26 08:27:33 -0500 |
| commit | 71d1e92e11093feb9a337f6d77078c5e75cbb92f (patch) | |
| tree | bca2bd4dff471022d36e1a1721326544dd0cb234 /tests/admin_scripts | |
| parent | e6108b7388775f4996a5906e0525fbdd40d2df51 (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/admin_scripts')
| -rw-r--r-- | tests/admin_scripts/tests.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 3b5b0380f0..114d819847 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -134,6 +134,7 @@ class AdminScriptTestCase(SimpleTestCase): python_path.extend(ext_backend_base_dirs) test_environ["PYTHONPATH"] = os.pathsep.join(python_path) test_environ["PYTHONWARNINGS"] = "" + test_environ["PYTHON_COLORS"] = "0" p = subprocess.run( [sys.executable, *args], @@ -2551,6 +2552,7 @@ class ArgumentOrder(AdminScriptTestCase): ) +@mock.patch.dict(os.environ, {"PYTHON_COLORS": "0"}) class ExecuteFromCommandLine(SimpleTestCase): def test_program_name_from_argv(self): """ |
