chore: use log_has_re for test log assertion

This commit is contained in:
Matthias
2025-03-04 06:46:13 +01:00
parent e055feb1d3
commit f785f9ff00

View File

@@ -701,11 +701,11 @@ def test_process_trade_creation(
assert pytest.approx(trade.amount) == 0
assert pytest.approx(trade.amount_requested) == 60 / ticker_usdt.return_value[ticker_side]
expected_log = (
assert log_has_re(
f"{'Short' if is_short else 'Long'} signal found: about create a new trade for ETH/USDT "
"with stake_amount: 60.0"
r"with stake_amount: 60.0 and price: .*",
caplog,
)
assert expected_log in caplog.text
mocker.patch("freqtrade.freqtradebot.FreqtradeBot._check_and_execute_exit")
# Fill trade.