Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] fix open orders check test #2675

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Loading