]> granicus.if.org Git - python/commitdiff
This test depends on the exact ordering produced by the WichmannHill
authorRaymond Hettinger <python@rcn.com>
Mon, 30 Dec 2002 00:46:09 +0000 (00:46 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 30 Dec 2002 00:46:09 +0000 (00:46 +0000)
random number generator.  Altered it a bit to use the old generator
and restore the test.

Lib/test/test_generators.py

index 9078b5564e221218e83b828036230783a9f7894b..c72fae72a3ae0df9375a01a724c9c929fa622c2f 100644 (file)
@@ -444,15 +444,15 @@ Subject: Re: PEP 255: Simple Generators
 >>> roots = sets[:]
 
 >>> import random
->>> random.seed(42)
+>>> gen = random.WichmannHill(42)
 >>> while 1:
 ...     for s in sets:
 ...         print "%s->%s" % (s, s.find()),
 ...     print
 ...     if len(roots) > 1:
-...         s1 = random.choice(roots)
+...         s1 = gen.choice(roots)
 ...         roots.remove(s1)
-...         s2 = random.choice(roots)
+...         s2 = gen.choice(roots)
 ...         s1.union(s2)
 ...         print "merged", s1, "into", s2
 ...     else: