mirror of https://github.com/Textualize/rich.git
no color test
This commit is contained in:
parent
c436acfcb0
commit
6bac7ffb86
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue