flake8 fix and cleanup

This commit is contained in:
Axel-CH 2024-09-11 21:48:48 -04:00
parent 2811a470aa
commit 6b8ca7217b
3 changed files with 3 additions and 14 deletions

View File

@ -480,23 +480,12 @@ def test_dca_order_adjust(default_conf_usdt, ticker_usdt, leverage, fee, mocker,
assert pytest.approx(trade.orders[-1].amount) == 91.689215 * leverage assert pytest.approx(trade.orders[-1].amount) == 91.689215 * leverage
assert freqtrade.strategy.adjust_entry_price.call_count == 0 assert freqtrade.strategy.adjust_entry_price.call_count == 0
print("BEFORE Process trade.orders")
print(trade.orders)
# adding this will prevent the second exit order creation, but this test case must be handled properly
#freqtrade.strategy.custom_exit = MagicMock(return_value=None)
caplog.clear() caplog.clear()
caplog.set_level(logging.DEBUG) caplog.set_level(logging.DEBUG)
# Process again, should not adjust entry price # Process again, should not adjust entry price
freqtrade.process() freqtrade.process()
trade = Trade.get_trades().first() trade = Trade.get_trades().first()
print(f"DEBUG TEST")
print(caplog.text)
print("AFTER Process trade.orders")
print(trade.orders)
assert trade.orders[-2].status == "canceled" assert trade.orders[-2].status == "canceled"
assert len(trade.orders) == 6 assert len(trade.orders) == 6
assert trade.orders[-1].side == trade.exit_side assert trade.orders[-1].side == trade.exit_side