[TIP] Functions for tests instead of classes

Ryan Freckleton ryan.freckleton at gmail.com
Thu Mar 4 14:03:04 PST 2010


On Wed, Mar 3, 2010 at 12:15 PM, Michael Foord <fuzzyman at voidspace.org.uk>wrote:
<snip>


> Once Holger and Benjamin have worked on their ast transformation code it
> should be possible to add this to simpletest for better failure messages
> with plain asserts.
>
<snip>

Does that mean we're going to get pretty asserts through ast transforms? As
in:

    assert obj.froddle() == "baz"

gets transformed into like (or at least functionally equivalent to):

result = object.froddle()
expected = "baz"
assert result == expected, "%s != %s" % (result, expected)

If so, that's fantastic! The same thought crossed my mind to implement that
with ast transforms, but I don't have enough ast-fu to implement it.


=====
--Ryan E. Freckleton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100304/4c9b26cc/attachment-0001.htm>


More information about the testing-in-python mailing list