From 92c03b8f30a7bed90ea775ba7b8da761014b035f Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Mon, 15 Jul 2024 11:06:12 +0200 Subject: [PATCH] [Tests] fix open orders check test --- .../abstract_authenticated_exchange_tester.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py index 87b73efec..88aa01dc1 100644 --- a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py +++ b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py @@ -1016,7 +1016,9 @@ async def order_in_fetched_orders(self, method, previous_orders, order, symbol=N print(f"=> {self.exchange_manager.exchange_name} {order.order_type} Order found in {len(fetched_orders)} " f"{method.__name__} after after {time.time() - t0} seconds and {iterations} iterations. " f"Order: [{order}].") - assert len(fetched_orders) == len(previous_orders) + 1 + # use in as exchanges can have a max amount of fetched elements + assert len(fetched_orders) in (len(previous_orders), len(previous_orders) + 1), \ + f"{len(fetched_orders)} not in {len(previous_orders), len(previous_orders) + 1}" return True else: # check order not in open orders @@ -1039,7 +1041,7 @@ async def order_in_fetched_orders(self, method, previous_orders, order, symbol=N f" in {len(fetched_orders)} {method.__name__} after after {time.time() - t0} seconds " f"and {iterations} iterations. " f"Order: [{order}].") - assert len(fetched_orders) == max(len(previous_orders) - 1, 0) + assert len(fetched_orders) <= len(previous_orders), f"{len(fetched_orders)} !<= {len(previous_orders)}" # order not found return True await asyncio.sleep(1)