Kaydet (Commit) be0e177a authored tarafından Benjamin Peterson's avatar Benjamin Peterson

account for range() py3k change

üst 06b60410
......@@ -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)
......
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