Commit 3d34ff57 authored by Jeremy Hylton's avatar Jeremy Hylton

It is customary to include an argument list at the end of a def line.

Also:
    - call shuffle correctly.
    - simplify test_suite()
parent db2e6ca1
...@@ -56,7 +56,7 @@ class TestMultiUnion(TestCase): ...@@ -56,7 +56,7 @@ class TestMultiUnion(TestCase):
self.assertEqual(len(output), 50000) self.assertEqual(len(output), 50000)
self.assertEqual(list(output), range(50000)) self.assertEqual(list(output), range(50000))
def testLotsOfLittleOnes: def testLotsOfLittleOnes(self):
from random import shuffle from random import shuffle
N = 5000 N = 5000
inputs = [] inputs = []
...@@ -64,15 +64,13 @@ class TestMultiUnion(TestCase): ...@@ -64,15 +64,13 @@ class TestMultiUnion(TestCase):
base = i * 4 - N base = i * 4 - N
inputs.append(IISet([base, base+1])) inputs.append(IISet([base, base+1]))
inputs.append(IITreeSet([base+2, base+3])) inputs.append(IITreeSet([base+2, base+3]))
inputs.shuffle() shuffle(inputs)
output = multiunion(inputs) output = multiunion(inputs)
self.assertEqual(len(output), N*4) self.assertEqual(len(output), N*4)
self.assertEqual(list(output), range(-N, 3*N)) self.assertEqual(list(output), range(-N, 3*N))
def test_suite(): def test_suite():
alltests = TestSuite((makeSuite(TestMultiUnion, 'test'), return makeSuite(TestMultiUnion, 'test')
))
return alltests
def main(): def main():
TextTestRunner().run(test_suite()) TextTestRunner().run(test_suite())
......
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