unit testing

Eduardo O. Padoan eduardo.padoan at gmail.com
Sat Oct 6 00:32:37 CEST 2007


> What's the equivalent of unittest's "assertRaises"?
> In certain situations it is also useful to test wether an exception
> (along its type) is raised or not.
> Does py.test support such thing?

import py.test

py.test.raises(NameError, "blablabla")

-- 
http://www.advogato.org/person/eopadoan/
Bookmarks: http://del.icio.us/edcrypt



More information about the Python-list mailing list