[TIP] decorators in testing
ben+python at benfinney.id.au
Sat Apr 4 05:37:00 PDT 2009
Michael Gratton <michael at quuxo.com> writes:
> In Python, a test class might look like:
> class Foo(object):
> def newFoo(self): ...
> def handleFrobnostication(self): ...
> def destroyFoo(self): ...
> Does anyone have an implementation of this for Python?
‘nose’ allows setup and teardown functions to be written, then used to
decorate test functions:
From nose import with_setup
\ “I put contact lenses in my dog's eyes. They had little |
`\ pictures of cats on them. Then I took one out and he ran around |
_o__) in circles.” —Steven Wright |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090404/397805a1/attachment.pgp
More information about the testing-in-python