[py-dev] py.test: broken assert evaluate twice
Carl Friedrich Bolz
cfbolz at gmx.de
Sun Sep 2 21:26:55 CEST 2007
Hi Immanuel
Immanuel Scholz wrote:
> --nomagic isn't a cute solution either, as you get no information at all
> about the problem, and when people unaware of this run the test code
> without the option, they still get false information.
>
> I was thinking of a more comfortable solution. Is it possible in python
> to capture the assert call before it is made and cache the argument and
> then call to the original "assert"? This way, you don't have to remember
> to cache the call everytime yourself.
Various attempts were made in the history of py.test to solve this
particular problem, all not quite satisfactory. What we have now is a
kind of sensible trade-off between implementation effort and nice-ness.
Of course new ideas to try are welcome, but I don't thing it would be
easy to do.
Cheers,
Carl Friedrich
More information about the py-dev
mailing list