mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Test to ensure FORCE_COLOR works with empty value
This commit is contained in:
parent
be7c97ebd7
commit
f99633793a
1 changed files with 3 additions and 3 deletions
|
@ -930,9 +930,9 @@ def test_capturing_no_stdout_and_no_stderr_files(monkeypatch):
|
|||
assert capture.get() == "hello world\n"
|
||||
|
||||
|
||||
@mock.patch.dict(os.environ, {"FORCE_COLOR": "anything"})
|
||||
def test_force_color():
|
||||
@pytest.mark.parametrize("env_value", ["", "something", "0"])
|
||||
def test_force_color(env_value):
|
||||
# Even though we use a non-tty file, the presence of FORCE_COLOR env var
|
||||
# means is_terminal returns True.
|
||||
console = Console(file=io.StringIO())
|
||||
console = Console(file=io.StringIO(), _environ={"FORCE_COLOR": env_value})
|
||||
assert console.is_terminal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue