summaryrefslogtreecommitdiff
path: root/numpy/testing/tests
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-11-28 00:53:37 -0800
committerEric Wieser <wieser.eric@gmail.com>2017-11-28 09:05:42 -0800
commit7693f9df2dab9dd5f27e9d2bb89c6f80341c6e61 (patch)
tree72dc50ac53d789d1ab08de4572946a61cf5ebe67 /numpy/testing/tests
parentf0f8d6e412c62643ef702c1a46352f0ef267a1a1 (diff)
downloadnumpy-7693f9df2dab9dd5f27e9d2bb89c6f80341c6e61.tar.gz
MAINT: Simplify IntegerFormatter
This essentially reverts 83accefd143a0e3ee8b3160d0927b3ff616743de, which presumably worked around a bug in an ancient version of python Similarly, the try/excepts here were to handle `IntegerFormatter` being called on the wrong type of array, which no longer happens
Diffstat (limited to 'numpy/testing/tests')
-rw-r--r--numpy/testing/tests/test_utils.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 8f259cf4a..08d67153a 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -4,6 +4,7 @@ import warnings
import sys
import os
import itertools
+import textwrap
import numpy as np
from numpy.testing import (
@@ -289,17 +290,19 @@ class TestEqual(TestArrayEqual):
except AssertionError as e:
msg = str(e)
msg2 = msg.replace("shapes (2L,), (1L, 2L)", "shapes (2,), (1, 2)")
- msg_reference = "\nArrays are not equal\n\n" \
- "(shapes (2,), (1, 2) mismatch)\n" \
- " x: array([1, 2])\n" \
- " y: [repr failed for <matrix>: The truth value of an array " \
- "with more than one element is ambiguous. Use a.any() or " \
- "a.all()]"
+ msg_reference = textwrap.dedent("""\
+
+ Arrays are not equal
+
+ (shapes (2,), (1, 2) mismatch)
+ x: array([1, 2])
+ y: [repr failed for <matrix>: %d format: a number is required, not matrix]""")
try:
self.assertEqual(msg, msg_reference)
except AssertionError:
self.assertEqual(msg2, msg_reference)
+
class TestArrayAlmostEqual(_GenericTest, unittest.TestCase):
def setUp(self):