Hacker News new | ask | show | jobs
by karma_fountain 4632 days ago
Unless I'm missing something, assert scoreKeeper.Stats["Manning"]["Touchdowns"] == 1 is not the same unless in python you have some magic reflection. The output you get from that is just pass/fail. The output you get from the matcher method is the expected and actual values in a much nicer error message.
1 comments

you (& afandian) make a good point, and i believe that's roughly how py.test does it, by rewriting the code of test modules before running tests. which would be fair to call magic.

http://pytest.org/latest/assert.html#advanced-assertion-intr...