summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-04 20:13:29 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-04 20:13:29 (GMT)
commitb8717631561fec74cb1ab1963d918e53ead29a97 (patch)
tree211c80239be5ecafcee3df52fbb89da5076925dd /Lib/test
parented20ad8473d3ec5c44f0de03a4b0caf40cdc991f (diff)
downloadcpython-b8717631561fec74cb1ab1963d918e53ead29a97.zip
cpython-b8717631561fec74cb1ab1963d918e53ead29a97.tar.gz
cpython-b8717631561fec74cb1ab1963d918e53ead29a97.tar.bz2
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.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_random.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index 0396e58..139e8bf 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -490,11 +490,14 @@ class TestModule(unittest.TestCase):
self.failUnless(set(random.__all__) <= set(dir(random)))
def test_main(verbose=None):
- testclasses = (WichmannHill_TestBasicOps,
+ testclasses = [WichmannHill_TestBasicOps,
MersenneTwister_TestBasicOps,
- HardwareRandom_TestBasicOps,
TestDistributions,
- TestModule)
+ TestModule]
+
+ if random._urandom is not None:
+ testclasses.append(HardwareRandom_TestBasicOps)
+
test_support.run_unittest(*testclasses)
# verify reference counting