mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
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:
|
||||
with pytest.raises(SystemExit, match=r"0"):
|
||||
Arguments(["--version"]).get_parsed_arg()
|
||||
args = Arguments(["--version"]).get_parsed_arg()
|
||||
assert args["version_main"] is True
|
||||
|
||||
|
||||
def test_parse_args_invalid() -> None:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# pragma pylint: disable=missing-docstring
|
||||
|
||||
import re
|
||||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
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)
|
||||
|
||||
|
||||
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:
|
||||
"""
|
||||
Test that main() can start backtesting and also ensure we can pass some specific arguments
|
||||
|
||||
Reference in New Issue
Block a user