Remove --strategy from analysis test

This commit is contained in:
Matthias 2022-05-31 06:34:08 +02:00
parent c285ad0e2b
commit be6e0813db
2 changed files with 6 additions and 16 deletions

View File

@ -294,7 +294,6 @@ class Arguments:
analysis_cmd.set_defaults(func=start_analysis_entries_exits) analysis_cmd.set_defaults(func=start_analysis_entries_exits)
self._build_args(optionlist=ARGS_ANALYZE_ENTRIES_EXITS, parser=analysis_cmd) self._build_args(optionlist=ARGS_ANALYZE_ENTRIES_EXITS, parser=analysis_cmd)
# Add edge subcommand # Add edge subcommand
edge_cmd = subparsers.add_parser('edge', help='Edge module.', edge_cmd = subparsers.add_parser('edge', help='Edge module.',
parents=[_common_parser, _strategy_parser]) parents=[_common_parser, _strategy_parser])

View File

@ -1,5 +1,4 @@
import logging import logging
from pathlib import Path
from unittest.mock import MagicMock, PropertyMock from unittest.mock import MagicMock, PropertyMock
import pandas as pd import pandas as pd
@ -82,13 +81,10 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, tmp
'--config', 'config.json', '--config', 'config.json',
'--datadir', str(testdatadir), '--datadir', str(testdatadir),
'--user-data-dir', str(tmpdir), '--user-data-dir', str(tmpdir),
'--strategy-path', str(Path(__file__).parents[1] / 'strategy/strats'),
'--timeframe', '5m', '--timeframe', '5m',
'--timerange', '1515560100-1517287800', '--timerange', '1515560100-1517287800',
'--export', 'signals', '--export', 'signals',
'--cache', 'none', '--cache', 'none',
'--strategy-list',
'StrategyTestV3Analysis',
] ]
args = get_args(args) args = get_args(args)
start_backtesting(args) start_backtesting(args)
@ -104,13 +100,12 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, tmp
'--datadir', str(testdatadir), '--datadir', str(testdatadir),
'--user-data-dir', str(tmpdir), '--user-data-dir', str(tmpdir),
] ]
strat_args = ['--strategy', 'StrategyTestV3Analysis']
# test group 0 and indicator list # test group 0 and indicator list
args = get_args(base_args + args = get_args(base_args +
['--analysis-groups', '0', ['--analysis-groups', '0',
'--indicator-list', 'close,rsi,profit_abs'] + '--indicator-list', 'close,rsi,profit_abs']
strat_args) )
start_analysis_entries_exits(args) start_analysis_entries_exits(args)
captured = capsys.readouterr() captured = capsys.readouterr()
assert 'LTC/BTC' in captured.out assert 'LTC/BTC' in captured.out
@ -133,8 +128,7 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, tmp
assert '47.0996' in captured.out assert '47.0996' in captured.out
# test group 1 # test group 1
args = get_args(base_args + ['--analysis-groups', '1'] + args = get_args(base_args + ['--analysis-groups', '1'])
strat_args)
start_analysis_entries_exits(args) start_analysis_entries_exits(args)
captured = capsys.readouterr() captured = capsys.readouterr()
assert 'enter_tag_long_a' in captured.out assert 'enter_tag_long_a' in captured.out
@ -147,8 +141,7 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, tmp
assert '0' in captured.out assert '0' in captured.out
# test group 2 # test group 2
args = get_args(base_args + ['--analysis-groups', '2'] + args = get_args(base_args + ['--analysis-groups', '2'])
strat_args)
start_analysis_entries_exits(args) start_analysis_entries_exits(args)
captured = capsys.readouterr() captured = capsys.readouterr()
assert 'enter_tag_long_a' in captured.out assert 'enter_tag_long_a' in captured.out
@ -163,8 +156,7 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, tmp
assert '2.5' in captured.out assert '2.5' in captured.out
# test group 3 # test group 3
args = get_args(base_args + ['--analysis-groups', '3'] + args = get_args(base_args + ['--analysis-groups', '3'])
strat_args)
start_analysis_entries_exits(args) start_analysis_entries_exits(args)
captured = capsys.readouterr() captured = capsys.readouterr()
assert 'LTC/BTC' in captured.out assert 'LTC/BTC' in captured.out
@ -179,8 +171,7 @@ def test_backtest_analysis_nomock(default_conf, mocker, caplog, testdatadir, tmp
assert '2' in captured.out assert '2' in captured.out
# test group 4 # test group 4
args = get_args(base_args + ['--analysis-groups', '4'] + args = get_args(base_args + ['--analysis-groups', '4'])
strat_args)
start_analysis_entries_exits(args) start_analysis_entries_exits(args)
captured = capsys.readouterr() captured = capsys.readouterr()
assert 'LTC/BTC' in captured.out assert 'LTC/BTC' in captured.out