From c017366086e422e6397c9236ed14c7d6c79666ea Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 2 Dec 2023 17:37:46 +0100 Subject: [PATCH] Ensure testdata generation works for 1M data --- tests/conftest.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index b18032621..9b983882a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -87,11 +87,13 @@ def get_args(args): def generate_test_data(timeframe: str, size: int, start: str = '2020-07-05'): np.random.seed(42) - tf_mins = timeframe_to_minutes(timeframe) base = np.random.normal(20, 2, size=size) - - date = pd.date_range(start, periods=size, freq=f'{tf_mins}min', tz='UTC') + if timeframe == '1M': + date = pd.date_range(start, periods=size, freq='1MS', tz='UTC') + else: + tf_mins = timeframe_to_minutes(timeframe) + date = pd.date_range(start, periods=size, freq=f'{tf_mins}min', tz='UTC') df = pd.DataFrame({ 'date': date, 'open': base,