hjwp / pytest-icdiff

better error messages for assert equals in pytest
The Unlicense
312 stars 18 forks source link

Can we use Beeprint for objects? #23

Open rodfersou opened 2 years ago

rodfersou commented 2 years ago

https://github.com/panyanyany/beeprint

rodfersou commented 2 years ago

@jedie any reason for the thumbs down?

rodfersou commented 1 year ago

I'm creating a fork after wait more than 1 year for a feedback

thanks again 🙏

hjwp commented 1 year ago

haha sorry i'm not a very good maintainer.

would love to see some side-by-side comparisons of beeprint vs icdiff, if you get it all up and running?

rodfersou commented 1 year ago

@hjwp be my guest https://github.com/rodfersou/pytest-beeprint

it play nice with pydantic models after few tweaks in repr

rodfersou commented 1 year ago

@hjwp

image
hjwp commented 1 year ago

looks good! is it ok if i merge in your fork? i'll credit you in the readme...

hjwp commented 1 year ago

ok so the problem i ran into is that beeprint seems to ignore the width= argument, so it doesn't handle some long input types well. eg:

>>> beeprint.pp(list(range(50)), width=20)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
>>> beeprint.pp("hello " * 50, width=20)
'hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello
 hello hello hello hello hello hello '

I'd expect the two examples above to be breaking into multiple lines as soon as the width hits 20.