mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Additional fix to eliminate some word-ignores
This commit is contained in:
parent
862d4c8857
commit
40aa0800de
|
@ -482,12 +482,12 @@ def test_calculate_max_drawdown2():
|
|||
assert drawdown == 0.043965
|
||||
|
||||
|
||||
@pytest.mark.parametrize('profits,relative,highd,lowd,result,result_rel', [
|
||||
@pytest.mark.parametrize('profits,relative,highd,lowdays,result,result_rel', [
|
||||
([0.0, -500.0, 500.0, 10000.0, -1000.0], False, 3, 4, 1000.0, 0.090909),
|
||||
([0.0, -500.0, 500.0, 10000.0, -1000.0], True, 0, 1, 500.0, 0.5),
|
||||
|
||||
])
|
||||
def test_calculate_max_drawdown_abs(profits, relative, highd, lowd, result, result_rel):
|
||||
def test_calculate_max_drawdown_abs(profits, relative, highd, lowdays, result, result_rel):
|
||||
"""
|
||||
Test case from issue https://github.com/freqtrade/freqtrade/issues/6655
|
||||
[1000, 500, 1000, 11000, 10000] # absolute results
|
||||
|
@ -507,7 +507,7 @@ def test_calculate_max_drawdown_abs(profits, relative, highd, lowd, result, resu
|
|||
assert isinstance(drawdown, float)
|
||||
assert isinstance(drawdown_rel, float)
|
||||
assert hdate == init_date + timedelta(days=highd)
|
||||
assert ldate == init_date + timedelta(days=lowd)
|
||||
assert ldate == init_date + timedelta(days=lowdays)
|
||||
|
||||
# High must be before low
|
||||
assert hdate < ldate
|
||||
|
|
|
@ -30,7 +30,7 @@ def test_dp_ohlcv(mocker, default_conf, ohlcv_history, candle_type):
|
|||
assert dp.ohlcv("UNITTEST/BTC", timeframe, candle_type=candletype) is not ohlcv_history
|
||||
assert dp.ohlcv("UNITTEST/BTC", timeframe, copy=False, candle_type=candletype) is ohlcv_history
|
||||
assert not dp.ohlcv("UNITTEST/BTC", timeframe, candle_type=candletype).empty
|
||||
assert dp.ohlcv("NONESENSE/AAA", timeframe, candle_type=candletype).empty
|
||||
assert dp.ohlcv("NONSENSE/AAA", timeframe, candle_type=candletype).empty
|
||||
|
||||
# Test with and without parameter
|
||||
assert dp.ohlcv(
|
||||
|
@ -114,7 +114,7 @@ def test_get_pair_dataframe(mocker, default_conf, ohlcv_history, candle_type):
|
|||
assert dp.get_pair_dataframe("UNITTEST/BTC", timeframe,
|
||||
candle_type=candle_type) is not ohlcv_history
|
||||
assert not dp.get_pair_dataframe("UNITTEST/BTC", timeframe, candle_type=candle_type).empty
|
||||
assert dp.get_pair_dataframe("NONESENSE/AAA", timeframe, candle_type=candle_type).empty
|
||||
assert dp.get_pair_dataframe("NONSENSE/AAA", timeframe, candle_type=candle_type).empty
|
||||
|
||||
# Test with and without parameter
|
||||
assert dp.get_pair_dataframe("UNITTEST/BTC", timeframe, candle_type=candle_type)\
|
||||
|
@ -125,7 +125,7 @@ def test_get_pair_dataframe(mocker, default_conf, ohlcv_history, candle_type):
|
|||
assert dp.runmode == RunMode.LIVE
|
||||
assert isinstance(dp.get_pair_dataframe(
|
||||
"UNITTEST/BTC", timeframe, candle_type=candle_type), DataFrame)
|
||||
assert dp.get_pair_dataframe("NONESENSE/AAA", timeframe, candle_type=candle_type).empty
|
||||
assert dp.get_pair_dataframe("NONSENSE/AAA", timeframe, candle_type=candle_type).empty
|
||||
|
||||
historymock = MagicMock(return_value=ohlcv_history)
|
||||
mocker.patch("freqtrade.data.dataprovider.load_pair_history", historymock)
|
||||
|
|
Loading…
Reference in New Issue
Block a user