chore: update tests to modern typing syntax

This commit is contained in:
Matthias
2024-10-04 07:09:51 +02:00
parent 628983d123
commit 2e0a597ee4
10 changed files with 32 additions and 40 deletions

View File

@@ -29,10 +29,10 @@ class BTContainer(NamedTuple):
Minimal BacktestContainer defining Backtest inputs and results.
"""
data: List[List[float]]
data: list[list[float]]
stop_loss: float
roi: Dict[str, float]
trades: List[BTrade]
roi: dict[str, float]
trades: list[BTrade]
profit_perc: float
trailing_stop: bool = False
trailing_only_offset_is_reached: bool = False

View File

@@ -1,7 +1,6 @@
import logging
import re
from pathlib import Path
from typing import Dict, List
import numpy as np
import pytest
@@ -14,7 +13,7 @@ from tests.conftest import CURRENT_TEST_STRATEGY, log_has, log_has_re
# Functions for recurrent object patching
def create_results() -> List[Dict]:
def create_results() -> list[dict]:
return [{"loss": 1, "result": "foo", "params": {}, "is_best": True}]