Testing for exceptions could use a loop similar to above.  I'd also prefer using `numpy.testing.assert_raises` so that any failure can be traced to one particular statement.