jeudi 25 décembre 2014

Python nosetest ValueError exception

I have some function:



def reverse_number(num):
try:
return int(num)
except ValueError:
return "Please provide number"


and test for this:



assert_raises(ValueError, reverse.reverse_number, "error")


But when I call nosetests I got this error:



AssertionError: ValueError not raised


What am I doing wrong?


Aucun commentaire:

Enregistrer un commentaire