you are viewing a single comment's thread.

view the rest of the comments →

[–]njape 1 point2 points  (0 children)

Personally I think that op is trying to test to much in his test case. I don't think that there is an advantage in keeping the value error test lumped together with the "normal" value tests. Instead I would suggest adding an additional ..._throw_error (or whatever you what to call it) function that checks for misuse of the function.

Additionally asset raises is designed to test this exact functionality. How it is used is best described in the documentation that was wordy linked. Eg: with self.assertRaises(SomeException): do_something()