diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-07-25 01:02:01 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-07-25 01:02:01 (GMT) |
commit | be0e177ae52f84e2787f511693d4889d7fc9d5d7 (patch) | |
tree | 8ac23160ac5144d0a68dc8e83b4de55eef6859e6 /Doc/library/unittest.rst | |
parent | 06b6041071308b3d467e7bb6625ebbf492e07ba5 (diff) | |
download | cpython-be0e177ae52f84e2787f511693d4889d7fc9d5d7.zip cpython-be0e177ae52f84e2787f511693d4889d7fc9d5d7.tar.gz cpython-be0e177ae52f84e2787f511693d4889d7fc9d5d7.tar.bz2 |
account for range() py3k change
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r-- | Doc/library/unittest.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 955c794..283d2fd 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -172,13 +172,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) |