Raise TypeError for types that can't be compared to arrays.

This commit is contained in:
Kale Kundert
2017-07-22 09:05:12 -07:00
parent 4c45bc9971
commit ebc7346be4

View File

@@ -66,7 +66,7 @@ class ApproxNumpy(ApproxBase):
try:
actual = np.asarray(actual)
except:
raise ValueError("cannot compare '{0}' to numpy.ndarray".format(actual))
raise TypeError("cannot compare '{0}' to numpy.ndarray".format(actual))
if actual.shape != self.expected.shape:
return False