diff --git a/tests/test_issues.py b/tests/test_issues.py index ac6d451..b42aec6 100644 --- a/tests/test_issues.py +++ b/tests/test_issues.py @@ -33,14 +33,13 @@ def promise_with_wait(x, wait): return Promise.resolve(identity(x, wait)) -# def test_issue_9(): -# no_wait = Promise.all([promise_with_wait(x1, None).then(lambda y: x1*y) for x1 in (0,1,2,3)]).get() -# wait_a_bit = Promise.all([promise_with_wait(x2, 0.05).then(lambda y: x2*y) for x2 in (0,1,2,3)]).get() -# wait_longer = Promise.all([promise_with_wait(x3, 0.1).then(lambda y: x3*y) for x3 in (0,1,2,3)]).get() +def test_issue_9(): + no_wait = Promise.all([promise_with_wait(x1, None).then(lambda y: x1*y) for x1 in (0,1,2,3)]).get() + wait_a_bit = Promise.all([promise_with_wait(x2, 0.05).then(lambda y: x2*y) for x2 in (0,1,2,3)]).get() + wait_longer = Promise.all([promise_with_wait(x3, 0.1).then(lambda y: x3*y) for x3 in (0,1,2,3)]).get() -# assert no_wait == [0, 1, 4, 9] -# assert no_wait == wait_a_bit -# assert no_wait == wait_longer + assert no_wait == wait_a_bit + assert no_wait == wait_longer @Promise.safe