File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ def test_common_scripts_options() -> None:
8282
8383
8484def test_parse_args_version () -> None :
85- with pytest . raises ( SystemExit , match = r"0" ):
86- Arguments ([ "--version" ]). get_parsed_arg ()
85+ args = Arguments ([ "--version" ]). get_parsed_arg ()
86+ assert args [ "version_main" ] is True
8787
8888
8989def test_parse_args_invalid () -> None :
Original file line number Diff line number Diff line change 11# pragma pylint: disable=missing-docstring
22
3+ import re
34from copy import deepcopy
45from pathlib import Path
56from unittest .mock import MagicMock , PropertyMock
@@ -26,6 +27,14 @@ def test_parse_args_None(caplog) -> None:
2627 assert log_has_re (r"Usage of Freqtrade requires a subcommand.*" , caplog )
2728
2829
30+ def test_parse_args_version (capsys ) -> None :
31+ with pytest .raises (SystemExit ):
32+ main (["-V" ])
33+ captured = capsys .readouterr ()
34+ assert re .search (r"CCXT Version:\s.*" , captured .out , re .MULTILINE )
35+ assert re .search (r"Freqtrade Version:\s+freqtrade\s.*" , captured .out , re .MULTILINE )
36+
37+
2938def test_parse_args_backtesting (mocker ) -> None :
3039 """
3140 Test that main() can start backtesting and also ensure we can pass some specific arguments
You can’t perform that action at this time.
0 commit comments