def test_pmap_args(): args = [(1, 1), (2, 2), (3, 3), (4, 4)] r1 = pmap(fnargs, args) for res, args in zip(r1, args): assert res == args[0] + args[1], (res, args)
def test_pmap_kwargs(): args = [dict(a=1, b=1), dict(a=2, b=1), dict(a=3, b=1)] r1 = pmap(fndict, args) for res, args in zip(r1, args): assert res == args['a'] - args['b'], (res, args)
def test_pmap(): r1 = list(pmap(fn, [1, 2, 3, 4])) r2 = list(map(fn, [1, 2, 3, 4])) assert r1 == r2, (r1, r2)