diff --git a/accumulate/accumulate_test.py b/accumulate/accumulate_test.py index e3f592f328..427e4d16e1 100644 --- a/accumulate/accumulate_test.py +++ b/accumulate/accumulate_test.py @@ -18,9 +18,8 @@ def test_divmod(self): def test_composition(self): inp = [10, 17, 23] - fn1 = lambda x: divmod(x, 7) - fn2 = lambda x: 7 * x[0] + x[1] - self.assertEqual(inp, accumulate(accumulate(inp, fn1), fn2)) + self.assertEqual(inp, accumulate(accumulate(inp, lambda x: divmod(x, 7)), + lambda x: 7 * x[0] + x[1])) def test_capitalize(self): inp = ['hello', 'world'] @@ -30,8 +29,8 @@ def test_capitalize(self): def test_recursive(self): inp = list('abc') out = [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']] - fn = lambda x: accumulate(list('123'), lambda y: x + y) - self.assertEqual(out, accumulate(inp, fn)) + self.assertEqual(out, accumulate(inp, lambda x: accumulate(list('123'), + lambda y: x + y))) if __name__ == '__main__':