You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def test_rich_console_ex() -> None:
"""Validate that ConsoleEx can capture output from print() calls."""
console = Console(record=True, redirect=True)
console.print("alpha")
print("beta")
sys.stdout.write("gamma\n")
sys.stderr.write("delta\n")
# While not supposed to happen we want to be sure that this will not raise
# an exception. Some libraries may still sometimes send bytes to the
# streams, notable example being click.
# sys.stdout.write(b"epsilon\n") # type: ignore
text = console.export_text()
assert text == "alpha\nbeta\ngamma\ndelta\n"
E AssertionError: assert 'alpha\nbeta...elta\ndelta\n' == 'alpha\nbeta\ngamma\ndelta\n'
E alpha
E beta
E + beta
E + gamma
E gamma
E delta
E + delta
The following test (test_rich_console_ex) fails with:
========================================================================
src/enrich/test/test_console.py::test_rich_console_ex
____________________________ test_rich_console_ex _____________________________
def test_rich_console_ex() -> None:
"""Validate that ConsoleEx can capture output from print() calls."""
console = Console(record=True, redirect=True)
console.print("alpha")
print("beta")
sys.stdout.write("gamma\n")
sys.stderr.write("delta\n")
# While not supposed to happen we want to be sure that this will not raise
# an exception. Some libraries may still sometimes send bytes to the
# streams, notable example being click.
# sys.stdout.write(b"epsilon\n") # type: ignore
text = console.export_text()
E AssertionError: assert 'alpha\nbeta...elta\ndelta\n' == 'alpha\nbeta\ngamma\ndelta\n'
E alpha
E beta
E + beta
E + gamma
E gamma
E delta
E + delta
src/enrich/test/test_console.py:23: AssertionError
----------------------------- Captured stdout call -----------------------------
alpha
beta
gamma
delta
========================================================================
The text was updated successfully, but these errors were encountered: