Skip to content

Commit e405d24

Browse files
committed
Update random_tests/test_random.py
1 parent 12ca5d7 commit e405d24

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import unittest
2+
3+
import pytest
4+
5+
from dpnp import random
6+
from tests.third_party.cupy import testing
7+
8+
9+
@pytest.mark.skip("random.get_random_state() is not supported yet")
10+
class TestResetSeed(unittest.TestCase):
11+
12+
@testing.for_float_dtypes(no_float16=True)
13+
def test_reset_seed(self, dtype):
14+
rs = random.get_random_state()
15+
rs.seed(0)
16+
l1 = rs.rand(10, dtype=dtype)
17+
18+
rs = random.get_random_state()
19+
rs.seed(0)
20+
l2 = rs.rand(10, dtype=dtype)
21+
22+
testing.assert_array_equal(l1, l2)

0 commit comments

Comments
 (0)