Simplify some test setups

This commit is contained in:
Matthias 2023-01-20 08:28:50 +00:00
parent 58d48e79da
commit 28e51e2dfb
4 changed files with 0 additions and 8 deletions

View File

@ -241,7 +241,6 @@ def get_patched_freqtradebot(mocker, config) -> FreqtradeBot:
:return: FreqtradeBot :return: FreqtradeBot
""" """
patch_freqtradebot(mocker, config) patch_freqtradebot(mocker, config)
config['datadir'] = Path(config['datadir'])
return FreqtradeBot(config) return FreqtradeBot(config)

View File

@ -359,7 +359,6 @@ def test_backtesting_start(default_conf, mocker, testdatadir, caplog) -> None:
PropertyMock(return_value=['UNITTEST/BTC'])) PropertyMock(return_value=['UNITTEST/BTC']))
default_conf['timeframe'] = '1m' default_conf['timeframe'] = '1m'
default_conf['datadir'] = testdatadir
default_conf['export'] = 'signals' default_conf['export'] = 'signals'
default_conf['exportfilename'] = 'export.txt' default_conf['exportfilename'] = 'export.txt'
default_conf['timerange'] = '-1510694220' default_conf['timerange'] = '-1510694220'
@ -395,7 +394,6 @@ def test_backtesting_start_no_data(default_conf, mocker, caplog, testdatadir) ->
PropertyMock(return_value=['UNITTEST/BTC'])) PropertyMock(return_value=['UNITTEST/BTC']))
default_conf['timeframe'] = "1m" default_conf['timeframe'] = "1m"
default_conf['datadir'] = testdatadir
default_conf['export'] = 'none' default_conf['export'] = 'none'
default_conf['timerange'] = '20180101-20180102' default_conf['timerange'] = '20180101-20180102'
@ -416,7 +414,6 @@ def test_backtesting_no_pair_left(default_conf, mocker, caplog, testdatadir) ->
PropertyMock(return_value=[])) PropertyMock(return_value=[]))
default_conf['timeframe'] = "1m" default_conf['timeframe'] = "1m"
default_conf['datadir'] = testdatadir
default_conf['export'] = 'none' default_conf['export'] = 'none'
default_conf['timerange'] = '20180101-20180102' default_conf['timerange'] = '20180101-20180102'
@ -450,7 +447,6 @@ def test_backtesting_pairlist_list(default_conf, mocker, caplog, testdatadir, ti
mocker.patch('freqtrade.plugins.pairlistmanager.PairListManager.refresh_pairlist') mocker.patch('freqtrade.plugins.pairlistmanager.PairListManager.refresh_pairlist')
default_conf['ticker_interval'] = "1m" default_conf['ticker_interval'] = "1m"
default_conf['datadir'] = testdatadir
default_conf['export'] = 'none' default_conf['export'] = 'none'
# Use stoploss from strategy # Use stoploss from strategy
del default_conf['stoploss'] del default_conf['stoploss']
@ -548,7 +544,6 @@ def test_backtest__enter_trade_futures(default_conf_usdt, fee, mocker) -> None:
default_conf_usdt['trading_mode'] = 'futures' default_conf_usdt['trading_mode'] = 'futures'
default_conf_usdt['margin_mode'] = 'isolated' default_conf_usdt['margin_mode'] = 'isolated'
default_conf_usdt['stake_currency'] = 'USDT' default_conf_usdt['stake_currency'] = 'USDT'
default_conf_usdt['datadir'] = Path(default_conf_usdt['datadir'])
default_conf_usdt['exchange']['pair_whitelist'] = ['.*'] default_conf_usdt['exchange']['pair_whitelist'] = ['.*']
backtesting = Backtesting(default_conf_usdt) backtesting = Backtesting(default_conf_usdt)
backtesting._set_strategy(backtesting.strategylist[0]) backtesting._set_strategy(backtesting.strategylist[0])

View File

@ -53,7 +53,6 @@ def test_binance_mig_db_conversion(default_conf_usdt, fee, caplog):
t.exchange = 'binance' t.exchange = 'binance'
Trade.commit() Trade.commit()
default_conf_usdt['datadir'] = Path(default_conf_usdt['datadir'])
default_conf_usdt['trading_mode'] = 'futures' default_conf_usdt['trading_mode'] = 'futures'
migrate_binance_futures_names(default_conf_usdt) migrate_binance_futures_names(default_conf_usdt)
assert log_has('Migrating binance futures pairs in database.', caplog) assert log_has('Migrating binance futures pairs in database.', caplog)

View File

@ -449,7 +449,6 @@ def test_start_plot_profit_error(mocker):
def test_plot_profit(default_conf, mocker, testdatadir): def test_plot_profit(default_conf, mocker, testdatadir):
patch_exchange(mocker) patch_exchange(mocker)
default_conf['trade_source'] = 'file' default_conf['trade_source'] = 'file'
default_conf['datadir'] = testdatadir
default_conf['exportfilename'] = testdatadir / 'backtest-result_test_nofile.json' default_conf['exportfilename'] = testdatadir / 'backtest-result_test_nofile.json'
default_conf['pairs'] = ['ETH/BTC', 'LTC/BTC'] default_conf['pairs'] = ['ETH/BTC', 'LTC/BTC']