`numpy.testing` is a testing module, so it should not be used outside tests. Either use plain assertion or standard exception, preferably the latter.