Skip to content

Commit

Permalink
Improved issue testing
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Mar 5, 2017
1 parent 9cc068c commit b627500
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b627500

Please sign in to comment.