Commit b8717631 authored by Raymond Hettinger's avatar Raymond Hettinger

SF bug #1022010: Import random fails

* Complete the previous patch by making sure that the MachineRandom
  tests are only run when the underlying resource is available.
parent ed20ad84
...@@ -490,11 +490,14 @@ class TestModule(unittest.TestCase): ...@@ -490,11 +490,14 @@ class TestModule(unittest.TestCase):
self.failUnless(set(random.__all__) <= set(dir(random))) self.failUnless(set(random.__all__) <= set(dir(random)))
def test_main(verbose=None): def test_main(verbose=None):
testclasses = (WichmannHill_TestBasicOps, testclasses = [WichmannHill_TestBasicOps,
MersenneTwister_TestBasicOps, MersenneTwister_TestBasicOps,
HardwareRandom_TestBasicOps,
TestDistributions, TestDistributions,
TestModule) TestModule]
if random._urandom is not None:
testclasses.append(HardwareRandom_TestBasicOps)
test_support.run_unittest(*testclasses) test_support.run_unittest(*testclasses)
# verify reference counting # verify reference counting
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment