| Index: Lib/test/test_random.py |
| =================================================================== |
| --- Lib/test/test_random.py (revision 62635) |
| +++ Lib/test/test_random.py (working copy) |
| @@ -46,7 +46,7 @@ |
| # For the entire allowable range of 0 <= k <= N, validate that |
| # the sample is of the correct length and contains only unique items |
| N = 100 |
| - population = range(N) |
| + population = list(range(N)) |
| for k in range(N+1): |
| s = self.gen.sample(population, k) |
| self.assertEqual(len(s), k) |
| @@ -59,7 +59,7 @@ |
| # For the entire allowable range of 0 <= k <= N, validate that |
| # sample generates all possible permutations |
| n = 5 |
| - pop = range(n) |
| + pop = list(range(n)) |
| trials = 10000 # large num prevents false negatives without slowing normal case |
| def factorial(n): |
| if n == 0: |
| @@ -78,8 +78,8 @@ |
| def test_sample_inputs(self): |
| # SF bug #801342 -- population can be any iterable defining __len__() |
| self.gen.sample(set(range(20)), 2) |
| - self.gen.sample(range(20), 2) |
| - self.gen.sample(range(20), 2) |
| + self.gen.sample(list(range(20)), 2) |
| + self.gen.sample(list(range(20)), 2) |
| self.gen.sample(str('abcdefghijklmnopqrst'), 2) |
| self.gen.sample(tuple('abcdefghijklmnopqrst'), 2) |