added checks for python3.8 or lower since ast_comments.unparse() needs python 3.9 or higher.

testing with python 3.8 would make the build fail tests, skipping it there.
This commit is contained in:
hippocritical 2023-03-10 08:59:07 +01:00
parent 1bb697e58c
commit bfc7f48f17
2 changed files with 143 additions and 131 deletions

View File

@ -1,4 +1,5 @@
import logging
import sys
import time
from pathlib import Path
from typing import Any, Dict
@ -19,6 +20,12 @@ def start_strategy_update(args: Dict[str, Any]) -> None:
:return: None
"""
if sys.version_info <= (3, 8):
print("This code requires Python 3.9 or higher. "
"We cannot continue. "
"Please upgrade your python version to use this command.")
else:
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
strategy_objs = StrategyResolver.search_all_objects(

View File

@ -1,9 +1,14 @@
# pragma pylint: disable=missing-docstring, protected-access, invalid-name
import sys
from freqtrade.strategy.strategyupdater import StrategyUpdater
def test_strategy_updater(default_conf, caplog) -> None:
if sys.version_info <= (3, 8):
print("skipped tests since python version is 3.8 or lower.")
else:
instance_strategy_updater = StrategyUpdater()
modified_code1 = instance_strategy_updater.update_code("""
class testClass(IStrategy):