summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-04-10 10:43:58 -0600
committerCharles Harris <charlesr.harris@gmail.com>2016-04-10 10:49:19 -0600
commita2c4c117478b34a0761a98a9e5c474ab5c4f5490 (patch)
treeb661a0ff9bf7d793d0cca737f24556e2fce3e90f /numpy/random
parent9a86dcb9ca63829e334748056ac4eb643b18bcd1 (diff)
downloadpython-numpy-a2c4c117478b34a0761a98a9e5c474ab5c4f5490.tar.gz
python-numpy-a2c4c117478b34a0761a98a9e5c474ab5c4f5490.tar.bz2
python-numpy-a2c4c117478b34a0761a98a9e5c474ab5c4f5490.zip
MAINT: Ignore DeprecationWarning for random_integers in tests.
The warning turned up when the numpy/randome/tests were run using $ python runtests.py -t numpy/random/tests/ It doesn't show when all the tests are run.
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/tests/test_random.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index a07fa52f5..013205835 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -260,11 +260,13 @@ class TestRandomDist(TestCase):
def test_random_integers(self):
np.random.seed(self.seed)
- actual = np.random.random_integers(-99, 99, size=(3, 2))
- desired = np.array([[31, 3],
- [-52, 41],
- [-48, -66]])
- assert_array_equal(actual, desired)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ actual = np.random.random_integers(-99, 99, size=(3, 2))
+ desired = np.array([[31, 3],
+ [-52, 41],
+ [-48, -66]])
+ assert_array_equal(actual, desired)
def test_random_integers_max_int(self):
# Tests whether random_integers can generate the
@@ -272,10 +274,12 @@ class TestRandomDist(TestCase):
# into a C long. Previous implementations of this
# method have thrown an OverflowError when attempting
# to generate this integer.
- actual = np.random.random_integers(np.iinfo('l').max,
- np.iinfo('l').max)
- desired = np.iinfo('l').max
- assert_equal(actual, desired)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ actual = np.random.random_integers(np.iinfo('l').max,
+ np.iinfo('l').max)
+ desired = np.iinfo('l').max
+ assert_equal(actual, desired)
def test_random_integers_deprecated(self):
with warnings.catch_warnings():