diff options
Diffstat (limited to 'numpy/random/tests')
-rw-r--r-- | numpy/random/tests/test_against_numpy.py | 1 | ||||
-rw-r--r-- | numpy/random/tests/test_generator_mt19937.py | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/numpy/random/tests/test_against_numpy.py b/numpy/random/tests/test_against_numpy.py index b930fcbff..9846ba38f 100644 --- a/numpy/random/tests/test_against_numpy.py +++ b/numpy/random/tests/test_against_numpy.py @@ -183,6 +183,7 @@ class TestAgainstNumPy(object): self.rs.standard_exponential) self._is_state_common_legacy() + @pytest.mark.xfail(reason='Stream broken for simplicity') def test_tomaxint(self): self._set_common_state() self._is_state_common() diff --git a/numpy/random/tests/test_generator_mt19937.py b/numpy/random/tests/test_generator_mt19937.py index 895e7fc6c..d76291d1a 100644 --- a/numpy/random/tests/test_generator_mt19937.py +++ b/numpy/random/tests/test_generator_mt19937.py @@ -639,6 +639,18 @@ class TestRandomDist(object): p = [None, None, None] assert_raises(ValueError, random.choice, a, p=p) + def test_choice_return_type(self): + # gh 9867 + p = np.ones(4) / 4. + actual = random.choice(4, 2) + assert actual.dtype == np.int64 + actual = random.choice(4, 2, replace=False) + assert actual.dtype == np.int64 + actual = random.choice(4, 2, p=p) + assert actual.dtype == np.int64 + actual = random.choice(4, 2, p=p, replace=False) + assert actual.dtype == np.int64 + def test_bytes(self): random.brng.seed(self.seed) actual = random.bytes(10) |