MCPcopy
hub / github.com/Textualize/rich / test_log

Function test_log

tests/test_console.py:279–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277
278
279def test_log() -> None:
280 console = Console(
281 file=io.StringIO(),
282 width=80,
283 color_system="truecolor",
284 log_time_format="TIME",
285 log_path=False,
286 _environ={},
287 )
288 console.log("foo", style="red")
289 expected = "\x1b[2;36mTIME\x1b[0m\x1b[2;36m \x1b[0m\x1b[31mfoo \x1b[0m\n"
290 result = console.file.getvalue()
291 print(repr(result))
292 assert result == expected
293
294
295def test_log_milliseconds() -> None:

Callers

nothing calls this directly

Calls 3

logMethod · 0.95
ConsoleClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected