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)