summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-10-31 08:28:30 +0200
committermattip <matti.picus@gmail.com>2019-10-31 08:28:30 +0200
commitfa2aa53b89765f2555adf76f0009b4c29a39099e (patch)
treed2b444c4fe532c972d8de1f437df8759f2832761
parent61bd4c2ed7d6abc1e489e0fba66ded4a7f3e2d42 (diff)
downloadnumpy-fa2aa53b89765f2555adf76f0009b4c29a39099e.tar.gz
MAINT: revert change to assert_array_equal, adjust tests
-rw-r--r--numpy/core/tests/test_regression.py3
-rw-r--r--numpy/random/tests/test_generator_mt19937_regressions.py3
-rw-r--r--numpy/random/tests/test_randomstate_regression.py3
-rw-r--r--numpy/random/tests/test_regression.py3
-rw-r--r--numpy/testing/_private/utils.py6
5 files changed, 10 insertions, 8 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index 4ba05539f..444cbd79c 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -2290,7 +2290,8 @@ class TestRegression(object):
uf = np.frompyfunc(f, 1, 0)
a = np.array([[1, 2, 3], [4, 5], [6, 7, 8, 9]], dtype=object)
assert_equal(uf(a), ())
- assert_array_equal(a, [[3, 2, 1], [5, 4], [9, 7, 8, 6]])
+ expected = np.array([[3, 2, 1], [5, 4], [9, 7, 8, 6]], dtype=object)
+ assert_array_equal(a, expected)
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
def test_leak_in_structured_dtype_comparison(self):
diff --git a/numpy/random/tests/test_generator_mt19937_regressions.py b/numpy/random/tests/test_generator_mt19937_regressions.py
index 95a3815df..e328c0c71 100644
--- a/numpy/random/tests/test_generator_mt19937_regressions.py
+++ b/numpy/random/tests/test_generator_mt19937_regressions.py
@@ -58,7 +58,8 @@ class TestRegression(object):
mt19937 = Generator(MT19937(12345))
shuffled = np.array(t, dtype=object)
mt19937.shuffle(shuffled)
- assert_array_equal(shuffled, [t[2], t[0], t[3], t[1]])
+ expected = np.array([t[2], t[0], t[3], t[1]], dtype=object)
+ assert_array_equal(np.array(shuffled, dtype=object), expected)
def test_call_within_randomstate(self):
# Check that custom BitGenerator does not call into global state
diff --git a/numpy/random/tests/test_randomstate_regression.py b/numpy/random/tests/test_randomstate_regression.py
index d33233760..827240cef 100644
--- a/numpy/random/tests/test_randomstate_regression.py
+++ b/numpy/random/tests/test_randomstate_regression.py
@@ -68,7 +68,8 @@ class TestRegression(object):
random.seed(12345)
shuffled = list(t)
random.shuffle(shuffled)
- assert_array_equal(shuffled, [t[0], t[3], t[1], t[2]])
+ expected = np.array([t[0], t[3], t[1], t[2]], dtype=object)
+ assert_array_equal(np.array(shuffled, dtype=object), expected)
def test_call_within_randomstate(self):
# Check that custom RandomState does not call into global state
diff --git a/numpy/random/tests/test_regression.py b/numpy/random/tests/test_regression.py
index c0a03cd1c..3cc289a80 100644
--- a/numpy/random/tests/test_regression.py
+++ b/numpy/random/tests/test_regression.py
@@ -66,7 +66,8 @@ class TestRegression(object):
np.random.seed(12345)
shuffled = list(t)
random.shuffle(shuffled)
- assert_array_equal(shuffled, [t[0], t[3], t[1], t[2]])
+ expected = np.array([t[0], t[3], t[1], t[2]], dtype=object)
+ assert_array_equal(np.array(shuffled, dtype=object), expected)
def test_call_within_randomstate(self):
# Check that custom RandomState does not call into global state
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index 5417359fe..8a31fcf15 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -688,10 +688,8 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
__tracebackhide__ = True # Hide traceback for py.test
from numpy.core import array, array2string, isnan, inf, bool_, errstate, all, max, object_
- with warnings.catch_warnings():
- warnings.filterwarnings('ignore', '', DeprecationWarning)
- x = array(x, copy=False, subok=True)
- y = array(y, copy=False, subok=True)
+ x = array(x, copy=False, subok=True)
+ y = array(y, copy=False, subok=True)
# original array for output formatting
ox, oy = x, y