Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_rich_console_ex fails with rich 12.5.1 #40

Open
Chedi opened this issue Sep 16, 2022 · 3 comments
Open

test_rich_console_ex fails with rich 12.5.1 #40

Chedi opened this issue Sep 16, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Chedi
Copy link

Chedi commented Sep 16, 2022

The following test (test_rich_console_ex) fails with:

  • enrich 1.2.7
  • rich 12.5.1
  • python 3.10

========================================================================
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()

   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

src/enrich/test/test_console.py:23: AssertionError
----------------------------- Captured stdout call -----------------------------
alpha
beta
gamma
delta

========================================================================

@ssbarnea ssbarnea added the bug Something isn't working label Oct 4, 2022
@ssbarnea
Copy link
Member

ssbarnea commented Oct 4, 2022

A PR would have being quite useful here.

@ssbarnea
Copy link
Member

ssbarnea commented Oct 4, 2022

This is caused by Textualize/rich#2172 and we will need to update the code to address this.

@tinvaan
Copy link

tinvaan commented Jan 10, 2023

This is caused by Textualize/rich#2172 and we will need to update the code to address this.

Just opened an upstream PR, fyi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants