unit testing

Paul Rubin http
Sat Oct 6 00:22:11 CEST 2007


Giampaolo Rodolà <gnewsg at gmail.com> writes:
> def test_answer():
>     assert 42 == 43
> 
> What's the equivalent of unittest's "assertRaises"?

def test_raises():
    try:
       thingy()
       assert 42 == 43
    except GoodException:
       pass



More information about the Python-list mailing list