Skip to content

Commit ebc7346

Browse files
committed
Raise TypeError for types that can't be compared to arrays.
1 parent 4c45bc9 commit ebc7346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_pytest/python_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __eq__(self, actual):
6666
try:
6767
actual = np.asarray(actual)
6868
except:
69-
raise ValueError("cannot compare '{0}' to numpy.ndarray".format(actual))
69+
raise TypeError("cannot compare '{0}' to numpy.ndarray".format(actual))
7070

7171
if actual.shape != self.expected.shape:
7272
return False

0 commit comments

Comments
 (0)