Commit a08a3c51 authored by Georg Brandl's avatar Georg Brandl

Merged revisions 74196 via svnmerge from

svn+ssh://svn.python.org/python/branches/py3k

........
  r74196 | benjamin.peterson | 2009-07-25 03:02:01 +0200 (Sa, 25 Jul 2009) | 1 line

  account for range() py3k change
........
parent 4a3b3095
......@@ -105,13 +105,13 @@ Here is a short script to test three functions from the :mod:`random` module::
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.seq = range(10)
self.seq = list(range(10))
def test_shuffle(self):
# make sure the shuffled sequence does not lose any elements
random.shuffle(self.seq)
self.seq.sort()
self.assertEqual(self.seq, range(10))
self.assertEqual(self.seq, list(range(10)))
def test_choice(self):
element = random.choice(self.seq)
......
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