Fix failures due to non-happening rounding
This commit is contained in:
parent
8943d42509
commit
685820cc12
@ -3015,7 +3015,7 @@ def test_execute_trade_exit_up(default_conf_usdt, ticker_usdt, fee, ticker_usdt_
|
|||||||
'pair': 'ETH/USDT',
|
'pair': 'ETH/USDT',
|
||||||
'gain': 'profit',
|
'gain': 'profit',
|
||||||
'limit': 2.0 if is_short else 2.2,
|
'limit': 2.0 if is_short else 2.2,
|
||||||
'amount': amt,
|
'amount': pytest.approx(amt),
|
||||||
'order_type': 'limit',
|
'order_type': 'limit',
|
||||||
'buy_tag': None,
|
'buy_tag': None,
|
||||||
'direction': 'Short' if trade.is_short else 'Long',
|
'direction': 'Short' if trade.is_short else 'Long',
|
||||||
@ -3076,7 +3076,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd
|
|||||||
'leverage': 1.0,
|
'leverage': 1.0,
|
||||||
'gain': 'loss',
|
'gain': 'loss',
|
||||||
'limit': 2.2 if is_short else 2.01,
|
'limit': 2.2 if is_short else 2.01,
|
||||||
'amount': 29.70297029 if is_short else 30.0,
|
'amount': pytest.approx(29.70297029) if is_short else 30.0,
|
||||||
'order_type': 'limit',
|
'order_type': 'limit',
|
||||||
'buy_tag': None,
|
'buy_tag': None,
|
||||||
'enter_tag': None,
|
'enter_tag': None,
|
||||||
@ -3156,13 +3156,13 @@ def test_execute_trade_exit_custom_exit_price(
|
|||||||
'leverage': 1.0,
|
'leverage': 1.0,
|
||||||
'gain': profit_or_loss,
|
'gain': profit_or_loss,
|
||||||
'limit': limit,
|
'limit': limit,
|
||||||
'amount': amount,
|
'amount': pytest.approx(amount),
|
||||||
'order_type': 'limit',
|
'order_type': 'limit',
|
||||||
'buy_tag': None,
|
'buy_tag': None,
|
||||||
'enter_tag': None,
|
'enter_tag': None,
|
||||||
'open_rate': open_rate,
|
'open_rate': open_rate,
|
||||||
'current_rate': current_rate,
|
'current_rate': current_rate,
|
||||||
'profit_amount': profit_amount,
|
'profit_amount': pytest.approx(profit_amount),
|
||||||
'profit_ratio': profit_ratio,
|
'profit_ratio': profit_ratio,
|
||||||
'stake_currency': 'USDT',
|
'stake_currency': 'USDT',
|
||||||
'fiat_currency': 'USD',
|
'fiat_currency': 'USD',
|
||||||
@ -3223,7 +3223,7 @@ def test_execute_trade_exit_down_stoploss_on_exchange_dry_run(
|
|||||||
'leverage': 1.0,
|
'leverage': 1.0,
|
||||||
'gain': 'loss',
|
'gain': 'loss',
|
||||||
'limit': 2.02 if is_short else 1.98,
|
'limit': 2.02 if is_short else 1.98,
|
||||||
'amount': 29.70297029 if is_short else 30.0,
|
'amount': pytest.approx(29.70297029 if is_short else 30.0),
|
||||||
'order_type': 'limit',
|
'order_type': 'limit',
|
||||||
'buy_tag': None,
|
'buy_tag': None,
|
||||||
'enter_tag': None,
|
'enter_tag': None,
|
||||||
@ -3486,13 +3486,13 @@ def test_execute_trade_exit_market_order(
|
|||||||
'leverage': 1.0,
|
'leverage': 1.0,
|
||||||
'gain': profit_or_loss,
|
'gain': profit_or_loss,
|
||||||
'limit': limit,
|
'limit': limit,
|
||||||
'amount': round(amount, 9),
|
'amount': pytest.approx(amount),
|
||||||
'order_type': 'market',
|
'order_type': 'market',
|
||||||
'buy_tag': None,
|
'buy_tag': None,
|
||||||
'enter_tag': None,
|
'enter_tag': None,
|
||||||
'open_rate': open_rate,
|
'open_rate': open_rate,
|
||||||
'current_rate': current_rate,
|
'current_rate': current_rate,
|
||||||
'profit_amount': profit_amount,
|
'profit_amount': pytest.approx(profit_amount),
|
||||||
'profit_ratio': profit_ratio,
|
'profit_ratio': profit_ratio,
|
||||||
'stake_currency': 'USDT',
|
'stake_currency': 'USDT',
|
||||||
'fiat_currency': 'USD',
|
'fiat_currency': 'USD',
|
||||||
|
Loading…
Reference in New Issue
Block a user