diff --git a/CHANGELOG.md b/CHANGELOG.md index 9316a342a..4dca3eff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `RichHandler` errors and warnings will now use different colors (red and yellow) https://github.com/Textualize/rich/issues/2825 - Removed the empty line printed in jupyter while using `Progress` https://github.com/Textualize/rich/pull/2616 +- Running tests in environment with `FORCE_COLOR` or `NO_COLOR` environment variables ### Added diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..52662964c --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,8 @@ +import pytest + + +@pytest.fixture(autouse=True) +def reset_color_envvars(monkeypatch): + """Remove color-related envvars to fix test output""" + monkeypatch.delenv("FORCE_COLOR", raising=False) + monkeypatch.delenv("NO_COLOR", raising=False)