-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] Can't print MagicMock.mock_calls #903
Comments
Mocks pretty much break introspection. The >>> hasattr(y.mock_calls[0], "__rich__")
True It doesn't support the Rich protocol of course, Printing the list works because the contents of the list are The solution may be to try and detect those mock call objects and special case them. |
Try v9.8.0 Should be fixed. |
I'll try it as soon as conda-forge/rich-feedstock#47 goes in, thanks! (PS: you can follow the instructions in the bot's PR description to setup auto merge on PRs; if things are not expected to break it makes conda-forge easier to maintain). |
It works now, thanks! |
Describe the bug
rich.print
does not print something that print does, breaking with:To Reproduce
If you remove the
rich.
or the*
, it works. I'm assuming it is suppose to fall back to repr/str, or is it supposed to break? The list containing it works just fine, just not singled out. This is a fairly unusual thing to print, I know, was working on a tutorial.Platform
macOS 11 Intel, normally iTerm2 though I was in JupyterLab 3 for this, 9.7.0 from conda-forge.
The text was updated successfully, but these errors were encountered: