Reformulate exception to be "nicer"

This commit is contained in:
Matthias 2021-11-26 06:27:06 +01:00
parent 5307d2bf3b
commit 897788de17
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ class Backtesting:
self.pairlists = PairListManager(self.exchange, self.config) self.pairlists = PairListManager(self.exchange, self.config)
if 'VolumePairList' in self.pairlists.name_list: if 'VolumePairList' in self.pairlists.name_list:
raise OperationalException("VolumePairList not allowed for backtesting. " raise OperationalException("VolumePairList not allowed for backtesting. "
"Use StaticPairlist.") "Please use StaticPairlist instead.")
if 'PerformanceFilter' in self.pairlists.name_list: if 'PerformanceFilter' in self.pairlists.name_list:
raise OperationalException("PerformanceFilter not allowed for backtesting.") raise OperationalException("PerformanceFilter not allowed for backtesting.")

View File

@ -439,7 +439,7 @@ def test_backtesting_no_pair_left(default_conf, mocker, caplog, testdatadir) ->
default_conf['pairlists'] = [{"method": "VolumePairList", "number_assets": 5}] default_conf['pairlists'] = [{"method": "VolumePairList", "number_assets": 5}]
with pytest.raises(OperationalException, with pytest.raises(OperationalException,
match='VolumePairList not allowed for backtesting. Use StaticPairlist.'): match=r'VolumePairList not allowed for backtesting\..*StaticPairlist.*'):
Backtesting(default_conf) Backtesting(default_conf)
default_conf.update({ default_conf.update({
@ -472,7 +472,7 @@ def test_backtesting_pairlist_list(default_conf, mocker, caplog, testdatadir, ti
default_conf['pairlists'] = [{"method": "VolumePairList", "number_assets": 5}] default_conf['pairlists'] = [{"method": "VolumePairList", "number_assets": 5}]
with pytest.raises(OperationalException, with pytest.raises(OperationalException,
match='VolumePairList not allowed for backtesting. Use StaticPairlist.'): match=r'VolumePairList not allowed for backtesting\..*StaticPairlist.*'):
Backtesting(default_conf) Backtesting(default_conf)
default_conf['pairlists'] = [{"method": "StaticPairList"}, {"method": "PerformanceFilter"}] default_conf['pairlists'] = [{"method": "StaticPairList"}, {"method": "PerformanceFilter"}]