From f4814a7d590eb0d56fcbae7c9f9b3eba99a71df0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 20 Oct 2022 19:57:56 +0200 Subject: [PATCH] Improve test resiliance to small roundings --- tests/test_integration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index f2504c23a..01a2801ad 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -420,7 +420,7 @@ def test_dca_order_adjust(default_conf_usdt, ticker_usdt, leverage, fee, mocker) assert trade.open_order_id is None # Open rate is not adjusted yet assert trade.open_rate == 1.99 - assert trade.stake_amount == 60 + assert pytest.approx(trade.stake_amount) == 60 assert trade.stop_loss_pct == -0.1 assert pytest.approx(trade.stop_loss) == 1.99 * (1 - 0.1 / leverage) assert pytest.approx(trade.initial_stop_loss) == 1.99 * (1 - 0.1 / leverage) @@ -446,7 +446,7 @@ def test_dca_order_adjust(default_conf_usdt, ticker_usdt, leverage, fee, mocker) assert len(trade.orders) == 4 assert trade.open_order_id is not None assert trade.open_rate == 1.99 - assert trade.stake_amount == 60 + assert pytest.approx(trade.stake_amount) == 60 assert trade.orders[-1].price == 1.95 assert pytest.approx(trade.orders[-1].cost) == 120 * leverage