Closed ogayot closed 1 year ago
FORCE_COLOR
is preferable, as the docs note it's for CIconftest.py
.I will update.
Okay turns out we can't use FORCE_COLOR
because we test the force colro functionality, and setting the TERM
env var around the whole test process or test disables pytest's colouring. Switched to localized overrides.
Thanks @adamchainz !
When running the test-suite with
TERM=unknown
, the tests fail because the generated output is not "rich".This happens because python rich will disable color and style if the
TERM
variable is set to eitherunknown
ordumb
[1]This patch monkey-patches the environment to make the test suite insensitive to the
TERM
variable.[1] https://rich.readthedocs.io/en/stable/console.html?highlight=unknown#environment-variables
Signed-off-by: Olivier Gayot olivier.gayot@canonical.com