From ebc7346be4da2d56e3c6f1686f545105f70b9c89 Mon Sep 17 00:00:00 2001 From: Kale Kundert Date: Sat, 22 Jul 2017 09:05:12 -0700 Subject: [PATCH] Raise TypeError for types that can't be compared to arrays. --- _pytest/python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/python_api.py b/_pytest/python_api.py index fe2222059..176aff590 100644 --- a/_pytest/python_api.py +++ b/_pytest/python_api.py @@ -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