Embellish fixture asserts with the paths and carve out fixture support file.#217
Conversation
jonasbardino
left a comment
There was a problem hiding this comment.
Thanks, generally looks good and valuable.
Could you please have another look at especially the new fixturesupp module, which could use some polish before merge?
Copyright header, missing docstrings and such classics.
|
The code you're commenting on was mostly just moved. I'm also not really sure why a missing header was called out was mentioned when I had included one in the new fixturesupp file. This was meant to be a really quick change to take care of your request to include the path in the assertion message. Have pushed a version without moving anything and a docstrings on anything in these changes. |
569a535 to
34c51f7
Compare
34c51f7 to
8d090b8
Compare
|
The moved code came with a clearly copy/pasted copyright header that needed adjustment to the new module name and year in tests/support/fixturesupp.py . That's all I meant. I did not check which functions just moved, but noted the missing docstrings when they showed in the diff. Anyway, thanks for helping out, and I'll see if I can this smaller version merged now. |
It was pointed out that assertions against snapshots was an odd-one-out with respect to the emphasis on helpful information in the face a test failure that we usually strive for. Specifically, we had not arrange the developer being told which fixture was failing its tests.
The reason for this was the fixture code had been written as grab fixture data via path then do whatever comparison as desired as opposed to exposing a compound assertion that would take a fixture file path and value and do an equality check - this formulation would have access to the path for display at the point the equality fails. Note we trade assertion flexibility for output quality but fixtures are almost always going to be an equality so not a problem.
Ride on the coattails of adding the abstraction and place all the fixture support code in its own separate support file whcih happens to follow a growing and healthy convention in the tree.