mirror of
https://github.com/Textualize/rich.git
synced 2026-02-06 10:58:48 +00:00
Ensure to unset FORCE_COLOR and NO_COLOR environment variables within
the scope of individual tests, in order to fix test failures when these
variables are set in the environment where tests are run, e.g. via:
NO_COLOR=1 tox
9 lines
245 B
Python
9 lines
245 B
Python
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)
|