Improve error messages when comparing against objects vs strings#4928
Improve error messages when comparing against objects vs strings#4928rcomer merged 6 commits intoSciTools:mainfrom
Conversation
rcomer
left a comment
There was a problem hiding this comment.
Wow, thanks for the fast work @stephenworsley! I agree that trying to list out exactly what didn't match might be more trouble than it's worth, but I have a suggestion to be a bit more explicit for the coord case.
5a7af34 to
d66c697
Compare
3295b8e to
6bd15c1
Compare
rcomer
left a comment
There was a problem hiding this comment.
Hi @stephenworsley, this looks good to me. Some very minor suggestions in line. I also wonder if it is worth updating the relevant tests to use assertRaisesRegex and check the message:
[Can't seem to find them for cube.coord !]
iris/lib/iris/tests/unit/cube/test_Cube.py
Lines 2670 to 2678 in d56824c
iris/lib/iris/tests/unit/cube/test_Cube.py
Lines 2612 to 2620 in d56824c
785ed92 to
d83ed1c
Compare
Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
d83ed1c to
5880aba
Compare
rcomer
left a comment
There was a problem hiding this comment.
Thanks @stephenworsley. Just waiting for the CI...
|
Seems docs are failing because https://docs.scipy.org/ is down, so the intersphinx mapping doesn't work. I'm inclined to merge anyway: the only doc change here is the whatsnew entry and it was fine before rebase. |
A simple change to error messages to address #4898.