magick mock

This commit is contained in:
Will McGugan 2021-01-11 21:37:04 +00:00
parent cfcd74dc00
commit aaa99b7c2c
2 changed files with 4 additions and 1 deletions

View File

@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed panel cropping when shrunk too bar - Fixed panel cropping when shrunk too bar
- Allow passing markdown over STDIN when using `python -m rich.markdown` - Allow passing markdown over STDIN when using `python -m rich.markdown`
- Fix printing MagicMock.mock_calls https://github.com/willmcgugan/rich/issues/903
## [9.7.0] - 2021-01-09 ## [9.7.0] - 2021-01-09

View File

@ -1058,7 +1058,9 @@ class Console:
for renderable in objects: for renderable in objects:
# I promise this is sane # I promise this is sane
# This detects an object which claims to have all attributes, such as MagicMock.mock_calls # This detects an object which claims to have all attributes, such as MagicMock.mock_calls
if hasattr(renderable, "jwevpw_eors4dfo6mwo345ermk7kdnfnwerwer"): if hasattr(
renderable, "jwevpw_eors4dfo6mwo345ermk7kdnfnwerwer"
): # pragma: no cover
renderable = repr(renderable) renderable = repr(renderable)
rich_cast = getattr(renderable, "__rich__", None) rich_cast = getattr(renderable, "__rich__", None)
if rich_cast: if rich_cast: