From cfbolz at gmx.de Sun Sep 2 21:26:55 2007 From: cfbolz at gmx.de (Carl Friedrich Bolz) Date: Sun, 02 Sep 2007 21:26:55 +0200 Subject: [py-dev] py.test: broken assert evaluate twice In-Reply-To: <46D686D0.9030002@tu-dresden.de> References: <46D67EFF.9060907@tu-dresden.de> <46D681C5.9030402@genesilico.pl> <46D686D0.9030002@tu-dresden.de> Message-ID: <46DB0E7F.2010106@gmx.de> 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