unit testing

Eduardo O. Padoan eduardo.padoan at gmail.com
Fri Oct 5 18:32:37 EDT 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