Originally reported by: BitBucket: wtanksleyjr, GitHub: wtanksleyjr
I have some code which runs:
assert len(mylist) == 2 *** *** 10
When this fails, py.test prints out something like:
- len([something, more, else, thing, bla, ...]) == (2 *** *** 10)
The problem is that it's impossible to tell exactly why the assert is failing -- the whole list can't reasonably be printed, and truncating the list loses the information that actually matters.
If a list inside a len is truncated, it would make sense to either display another level of simplification OR to print only the length (since you can't display the whole list).
Originally reported by: BitBucket: wtanksleyjr, GitHub: wtanksleyjr
I have some code which runs:
assert len(mylist) == 2 *** *** 10
When this fails, py.test prints out something like:
The problem is that it's impossible to tell exactly why the assert is failing -- the whole list can't reasonably be printed, and truncating the list loses the information that actually matters.
If a list inside a len is truncated, it would make sense to either display another level of simplification OR to print only the length (since you can't display the whole list).