Skip to content

Commit 0631205

Browse files
committed
update randint_respect_dtype_singleton to new randint behavior
1 parent 73d7e4a commit 0631205

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

mkl_random/tests/test_random.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class RandIntData(NamedTuple):
224224
def randint():
225225
rfunc_method = rnd.randint
226226
integral_dtypes = [
227-
np.bool_,
227+
np.bool,
228228
np.int8,
229229
np.uint8,
230230
np.int16,
@@ -323,8 +323,9 @@ def test_randint_respect_dtype_singleton(randint):
323323
assert_equal(sample.dtype, np.dtype(dt))
324324

325325
for dt in (bool, int):
326-
lbnd = 0 if dt is bool else np.iinfo(np.dtype(dt)).min
327-
ubnd = 2 if dt is bool else np.iinfo(np.dtype(dt)).max + 1
326+
# The legacy rng uses "long" as the default integer:
327+
lbnd = 0 if dt is bool else np.iinfo("long").min
328+
ubnd = 2 if dt is bool else np.iinfo("long").max + 1
328329

329330
# gh-7284: Ensure that we get Python data types
330331
sample = randint.rfunc(lbnd, ubnd, dtype=dt)

0 commit comments

Comments
 (0)