From ebd5b4d66469dc68f2397b8fe7d617f9a6e1bd3a Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 1 Mar 2024 15:04:53 -0500 Subject: [PATCH] Adjust existing strategy tests since None can now be returned from execute(). --- tests/test_strategy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_strategy.py b/tests/test_strategy.py index 1966314..0d5a949 100644 --- a/tests/test_strategy.py +++ b/tests/test_strategy.py @@ -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 = ( @@ -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 @@ -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()