From cca817cc5e7818c22d9b6ef972f1b1a83223c300 Mon Sep 17 00:00:00 2001 From: 4444J99 <4444J99@users.noreply.github.com> Date: Sat, 28 Nov 2026 17:45:08 -0500 Subject: [PATCH] test: clear ambient NO_COLOR before the suite imports rege.formatting (#34) --- rege/tests/conftest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 rege/tests/conftest.py diff --git a/rege/tests/conftest.py b/rege/tests/conftest.py new file mode 100644 index 0000000..f578f9c --- /dev/null +++ b/rege/tests/conftest.py @@ -0,0 +1,13 @@ +"""Test-session setup shared by the rege test suite. + +``rege.formatting`` reads ``NO_COLOR`` once at import time and blanks every +``Colors`` attribute when it is set. Agent harnesses and many CI shells export +``NO_COLOR=1``, which made the colour tests fail depending on the caller's +environment rather than the code (issue #34). Clear it before any test module +imports ``rege.formatting``; tests that exercise the NO_COLOR path set it +themselves with ``monkeypatch``/``patch.dict``. +""" + +import os + +os.environ.pop("NO_COLOR", None)