2 ms·
> pytest is great, but a just a bit too much magic for me. There isn't much magic there, just an import hook which rewrites the assertion during compilation.
by masklinn 9y ago
> pytest is great, but a just a bit too much magic for me.
There isn't much magic there, just an import hook which rewrites the assertion during compilation.
> And I really don't like it when you pass a user defined failure message, you lose all this nice introspection.
Er… you don't, that's what the second snippet shows: if you have a custom assertion message, it just prints the message alongside everything else…
- jgalt212 9y ago> Er… you don't, that's what the second snippet shows: if you have a custom assertion message, it just prints the message alongside everything else… Is that a new addition to pytest? I do seem to remember the user defined message stomping over whatever pytest would normally spit out.
- masklinn 9y agoThat seems to have been fixed in version 2.6.2 released in September 2014[0]: > Implement issue549: user-provided assertion messages now no longer replace the py.test introspection message but are shown in addition to them. [0] https://docs.pytest.org/en/latest/changelog.html#id228 https://docs.pytest.org/en/latest/changelog.html#id228
- jgalt212 9y agocool, thanks for clearing that up for me.