diff --git a/CHANGELOG.md b/CHANGELOG.md index d8378b72..acb53b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added rich.tree +- Added no_color argument to Console ## [9.6.2] - 2021-01-07 diff --git a/tests/test_console.py b/tests/test_console.py index b82c7659..82bc5b48 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -467,3 +467,14 @@ def test_console_style() -> None: expected = "\x1b[31mfoo\x1b[0m\n" result = console.file.getvalue() assert result == expected + + +def test_no_color(): + console = Console( + file=io.StringIO(), color_system="truecolor", force_terminal=True, no_color=True + ) + console.print("[bold magenta on red]FOO") + expected = "\x1b[1mFOO\x1b[0m\n" + result = console.file.getvalue() + print(repr(result)) + assert result == expected