mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
SF #1027105: HardwareRandom should be renamed OSRandom
Renamed the new generator at Trevor's recommendation. The name HardwareRandom suggested a bit more than it delivered (no radioactive decay detectors or such).
This commit is contained in:
parent
3e773fb622
commit
23f1241dc6
3 changed files with 24 additions and 20 deletions
|
@ -164,8 +164,8 @@ class WichmannHill_TestBasicOps(TestBasicOps):
|
|||
self.assertRaises(UserWarning, self.gen.randrange, 2**60)
|
||||
warnings.filters[:] = oldfilters
|
||||
|
||||
class HardwareRandom_TestBasicOps(TestBasicOps):
|
||||
gen = random.HardwareRandom()
|
||||
class SystemRandom_TestBasicOps(TestBasicOps):
|
||||
gen = random.SystemRandom()
|
||||
|
||||
def test_autoseed(self):
|
||||
# Doesn't need to do anything except not fail
|
||||
|
@ -496,11 +496,11 @@ def test_main(verbose=None):
|
|||
TestModule]
|
||||
|
||||
try:
|
||||
random.HardwareRandom().random()
|
||||
random.SystemRandom().random()
|
||||
except NotImplementedError:
|
||||
pass
|
||||
else:
|
||||
testclasses.append(HardwareRandom_TestBasicOps)
|
||||
testclasses.append(SystemRandom_TestBasicOps)
|
||||
|
||||
test_support.run_unittest(*testclasses)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue