From be0e177ae52f84e2787f511693d4889d7fc9d5d7 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 25 Jul 2009 01:02:01 +0000 Subject: account for range() py3k change --- Doc/library/unittest.rst | 4 ++-- 1 file 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) -- cgit v0.12