Skip to content

Commit

Permalink
Adjust existing strategy tests since None can now be returned from ex…
Browse files Browse the repository at this point in the history
…ecute().
  • Loading branch information
derekpierre committed Mar 1, 2024
1 parent d7588af commit ebd5b4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_timeout_strategy(w3, mocker):

# 1) tx just created a does not time out
for i in range(3):
assert timeout_strategy.execute(pending_tx) == params
assert timeout_strategy.execute(pending_tx) is None # no change to params

# 2) remaining time is < warn factor; still doesn't time out but we warn about it
pending_tx.created = (
Expand All @@ -53,7 +53,7 @@ def warning_trapper(event):
warnings.append(event)

globalLogPublisher.addObserver(warning_trapper)
assert timeout_strategy.execute(pending_tx) == params
assert timeout_strategy.execute(pending_tx) is None # no change to params
globalLogPublisher.removeObserver(warning_trapper)

assert len(warnings) == 1
Expand All @@ -65,7 +65,7 @@ def warning_trapper(event):

# 3) close to timeout but not quite (5s short)
pending_tx.created = (now - timedelta(seconds=(TIMEOUT - 5))).timestamp()
assert timeout_strategy.execute(pending_tx) == params
assert timeout_strategy.execute(pending_tx) is None # no change to params

# 4) timeout
pending_tx.created = (now - timedelta(seconds=(TIMEOUT + 1))).timestamp()
Expand Down

0 comments on commit ebd5b4d

Please sign in to comment.