summaryrefslogtreecommitdiff
path: root/numpy/random/tests/test_direct.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/random/tests/test_direct.py')
-rw-r--r--numpy/random/tests/test_direct.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/random/tests/test_direct.py b/numpy/random/tests/test_direct.py
index ca6dbb58d..5ae71ade7 100644
--- a/numpy/random/tests/test_direct.py
+++ b/numpy/random/tests/test_direct.py
@@ -4,7 +4,7 @@ from os.path import join
import numpy as np
from numpy.testing import (assert_equal, assert_allclose, assert_array_equal,
- assert_raises)
+ assert_raises, assert_warns)
import pytest
from numpy.random import (Generator, MT19937, DSFMT, ThreeFry,
@@ -191,6 +191,13 @@ class Base(object):
assert_allclose(uniforms, vals)
assert_equal(uniforms.dtype, np.float64)
+ rs = Generator(self.bit_generator(*self.data2['seed']))
+ vals = uniform_from_uint(self.data2['data'], self.bits)
+ with assert_warns(RuntimeWarning):
+ uniforms = rs.random_sample(len(vals))
+ assert_allclose(uniforms, vals)
+ assert_equal(uniforms.dtype, np.float64)
+
def test_uniform_float(self):
rs = Generator(self.bit_generator(*self.data1['seed']))
vals = uniform32_from_uint(self.data1['data'], self.bits)