diff options
author | AMIR <31338382+amiremohamadi@users.noreply.github.com> | 2020-12-21 23:45:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 23:45:50 (GMT) |
commit | b8fde8b5418b75d2935d0ff93b20d45d5350f206 (patch) | |
tree | 5a02911a3c8ea448fe7b56e436513f1f466457d7 /Lib | |
parent | 711381dfb09fbd434cc3b404656f7fd306161a64 (diff) | |
download | cpython-b8fde8b5418b75d2935d0ff93b20d45d5350f206.zip cpython-b8fde8b5418b75d2935d0ff93b20d45d5350f206.tar.gz cpython-b8fde8b5418b75d2935d0ff93b20d45d5350f206.tar.bz2 |
bpo-42008: Fix internal _random.Random() seeding for the one argument case (GH-22668)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_random.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 327bfa3..e7f911d 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -414,6 +414,15 @@ class TestBasicOps: r = _random.Random() self.assertRaises(TypeError, pickle.dumps, r, proto) + @test.support.cpython_only + def test_bug_42008(self): + # _random.Random should call seed with first element of arg tuple + import _random + r1 = _random.Random() + r1.seed(8675309) + r2 = _random.Random(8675309) + self.assertEqual(r1.random(), r2.random()) + def test_bug_1727780(self): # verify that version-2-pickles can be loaded # fine, whether they are created on 32-bit or 64-bit |