test: update tests for new --version handling
This commit is contained in:
@@ -82,8 +82,8 @@ def test_common_scripts_options() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def test_parse_args_version() -> None:
|
def test_parse_args_version() -> None:
|
||||||
with pytest.raises(SystemExit, match=r"0"):
|
args = Arguments(["--version"]).get_parsed_arg()
|
||||||
Arguments(["--version"]).get_parsed_arg()
|
assert args["version_main"] is True
|
||||||
|
|
||||||
|
|
||||||
def test_parse_args_invalid() -> None:
|
def test_parse_args_invalid() -> None:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# pragma pylint: disable=missing-docstring
|
# pragma pylint: disable=missing-docstring
|
||||||
|
|
||||||
|
import re
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest.mock import MagicMock, PropertyMock
|
from unittest.mock import MagicMock, PropertyMock
|
||||||
@@ -26,6 +27,14 @@ def test_parse_args_None(caplog) -> None:
|
|||||||
assert log_has_re(r"Usage of Freqtrade requires a subcommand.*", caplog)
|
assert log_has_re(r"Usage of Freqtrade requires a subcommand.*", caplog)
|
||||||
|
|
||||||
|
|
||||||
|
def test_parse_args_version(capsys) -> None:
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
main(["-V"])
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert re.search(r"CCXT Version:\s.*", captured.out, re.MULTILINE)
|
||||||
|
assert re.search(r"Freqtrade Version:\s+freqtrade\s.*", captured.out, re.MULTILINE)
|
||||||
|
|
||||||
|
|
||||||
def test_parse_args_backtesting(mocker) -> None:
|
def test_parse_args_backtesting(mocker) -> None:
|
||||||
"""
|
"""
|
||||||
Test that main() can start backtesting and also ensure we can pass some specific arguments
|
Test that main() can start backtesting and also ensure we can pass some specific arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user