From db2e6f2d1c9a25c077f660c1738bc65b64f26a7e Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Tue, 28 May 2019 23:25:53 +0300 Subject: [PATCH] tests adjusted --- freqtrade/tests/test_main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/freqtrade/tests/test_main.py b/freqtrade/tests/test_main.py index e4ffc5fae..9e7cc4a66 100644 --- a/freqtrade/tests/test_main.py +++ b/freqtrade/tests/test_main.py @@ -20,7 +20,9 @@ def test_parse_args_backtesting(mocker) -> None: further argument parsing is done in test_arguments.py """ backtesting_mock = mocker.patch('freqtrade.optimize.backtesting.start', MagicMock()) - main(['backtesting']) + # it's sys.exit(0) at the end of backtesting + with pytest.raises(SystemExit): + main(['backtesting']) assert backtesting_mock.call_count == 1 call_args = backtesting_mock.call_args[0][0] assert call_args.config == ['config.json'] @@ -33,7 +35,9 @@ def test_parse_args_backtesting(mocker) -> None: def test_main_start_hyperopt(mocker) -> None: hyperopt_mock = mocker.patch('freqtrade.optimize.hyperopt.start', MagicMock()) - main(['hyperopt']) + # it's sys.exit(0) at the end of hyperopt + with pytest.raises(SystemExit): + main(['hyperopt']) assert hyperopt_mock.call_count == 1 call_args = hyperopt_mock.call_args[0][0] assert call_args.config == ['config.json']