diff options
author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2019-05-28 10:35:57 +0100 |
---|---|---|
committer | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2019-05-28 23:53:52 +0100 |
commit | fbd9c515fcbf46b10e983067266272ca90c6d342 (patch) | |
tree | 3e4df1ce4a79e65dff5cda419e1185e564c77e26 /numpy/random/tests/test_randomstate_regression.py | |
parent | 22239d120f59826e8a2c758f4bee9893e835f511 (diff) | |
download | numpy-fbd9c515fcbf46b10e983067266272ca90c6d342.tar.gz |
BUG/MAINT: Disallow non-native byteorder in random ints
Warn that non-native byte order is not supported in randint and integers
closes #13159
Diffstat (limited to 'numpy/random/tests/test_randomstate_regression.py')
-rw-r--r-- | numpy/random/tests/test_randomstate_regression.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/random/tests/test_randomstate_regression.py b/numpy/random/tests/test_randomstate_regression.py index 9c319319e..5bb1ddde5 100644 --- a/numpy/random/tests/test_randomstate_regression.py +++ b/numpy/random/tests/test_randomstate_regression.py @@ -1,4 +1,7 @@ import sys + +import pytest + from numpy.testing import ( assert_, assert_array_equal, assert_raises, ) @@ -155,3 +158,9 @@ class TestRegression(object): perm = random.permutation(m) assert_array_equal(perm, np.array([2, 1, 4, 0, 3])) assert_array_equal(m.__array__(), np.arange(5)) + + def test_warns_byteorder(self): + # GH 13159 + other_byteord_dt = '<i4' if sys.byteorder == 'big' else '>i4' + with pytest.deprecated_call(match='non-native byteorder is not'): + random.randint(0, 200, size=10, dtype=other_byteord_dt) |