Skip to content

Commit eb0f7ec

Browse files
updated tests for numpy 1.19.1
1 parent dd5195e commit eb0f7ec

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

mkl_random/tests/test_random.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
from __future__ import division, absolute_import, print_function
2828

2929
import numpy as np
30+
from unittest import TestCase
3031
from numpy.testing import (
31-
TestCase, run_module_suite, assert_, assert_raises, assert_equal,
32+
run_module_suite, assert_, assert_raises, assert_equal,
3233
assert_warns, suppress_warnings)
3334
import mkl_random as rnd
3435
from numpy.compat import asbytes
@@ -909,7 +910,7 @@ def test_zipf(self):
909910
np.testing.assert_array_equal(actual, desired)
910911

911912

912-
class TestThread_Intel(object):
913+
class TestThread_Intel(TestCase):
913914
# make sure each state produces the same sequence even in threads
914915
def setUp(self):
915916
self.seeds = range(4)

mkl_random/tests/test_regression.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ def test_shuffle_mixed_dimension(self):
9595
[1, (2, 2), (3, 3), None],
9696
[(1, 1), 2, 3, None]]:
9797
rnd.seed(12345, brng='MT2203')
98-
shuffled = list(t)
98+
shuffled = np.array(list(t), dtype=object)
9999
rnd.shuffle(shuffled)
100-
assert_array_equal(shuffled, [t[0], t[2], t[1], t[3]])
100+
expected = np.array([t[0], t[2], t[1], t[3]], dtype=object)
101+
assert_array_equal(shuffled, expected)
101102

102103
def test_call_within_randomstate(self):
103104
# Check that custom RandomState does not call into global state
@@ -158,7 +159,7 @@ def test_shuffle_of_array_of_objects(self):
158159
# a segfault on garbage collection.
159160
# See gh-7719
160161
rnd.seed(1234)
161-
a = np.array([np.arange(1), np.arange(4)])
162+
a = np.array([np.arange(4), np.arange(4)])
162163

163164
for _ in range(1000):
164165
rnd.shuffle(a)

0 commit comments

Comments
 (0)