Hi,
I'm just wondering what the accepted way to handle unit testing exceptions is? 
I know you are meant to use assertRaises, but my code seems a little off.
try:    some_func()
except SomeException:    self.assertRaises(SomeException)
Is there a better way to do this at all? The problem with the above code is 
that if no exception is raised the code completely skips the except block and 
that would mean that the unit test would pass so, I considered adding:
self.fail('No exception raised')
at the end outside of the except block but not sure if that is what I need to 
do.
Any help is appreciated.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to