You have probably seen how PyTest reports errors:
def test_make_empty_file(): name = "/tmp/empty_test" make_empty_file(name) with open(name, "r") as fp: > assert not fp.read() E assert not 'hello' E + where 'hello' = () E + where = .read
But do you know how it does it? And have you ever seen the error like
assertion failed, but when it was re-run for printing intermediate values, it did not fail.
I do really recommend reading this article http://pybites.blogspot.com/2011/07/behind-scenes-of-pytests-new-assertion.html