From 70d7dcd189ff44cb9dfdba47ea03be13792b04fe Mon Sep 17 00:00:00 2001 From: Mihail <30621622+mihalt@users.noreply.github.com> Date: Wed, 3 Sep 2025 19:55:37 +0000 Subject: [PATCH] Made test_merge_informative_pair_monthly asserts data dependent. --- tests/strategy/test_strategy_helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/strategy/test_strategy_helpers.py b/tests/strategy/test_strategy_helpers.py index 710dcc559..982dd184f 100644 --- a/tests/strategy/test_strategy_helpers.py +++ b/tests/strategy/test_strategy_helpers.py @@ -101,7 +101,8 @@ def test_merge_informative_pair_monthly(): candle1 = result.loc[(result["date"] == "2022-12-31T22:00:00.000Z")] assert candle1.iloc[0]["date"] == pd.Timestamp("2022-12-31T22:00:00.000Z") assert candle1.iloc[0]["date_1M"] == pd.Timestamp("2022-11-01T00:00:00.000Z") - assert candle1.iloc[0]["volume_1M"] == np.float64(199.11048557037446) + prev_m_vol = informative.loc[informative["date"] == "2022-11-01T00:00:00.000", "volume"] + assert candle1.iloc[0]["volume_1M"] == prev_m_vol.iloc[0] candle2 = result.loc[(result["date"] == "2022-12-31T23:00:00.000Z")] assert candle2.iloc[0]["date"] == pd.Timestamp("2022-12-31T23:00:00.000Z") @@ -110,7 +111,8 @@ def test_merge_informative_pair_monthly(): # Candle is empty, as the start-date did fail. candle3 = result.loc[(result["date"] == "2022-11-30T22:00:00.000Z")] assert candle3.iloc[0]["date"] == pd.Timestamp("2022-11-30T22:00:00.000Z") - assert candle3.iloc[0]["volume_1M"] == np.float64(199.2462638356425) + prev_m_vol = informative.loc[informative["date"] == "2022-10-01 00:00:00+00:00", "volume"] + assert candle3.iloc[0]["volume_1M"] == prev_m_vol.iloc[0] # First candle with 1M data merged. candle4 = result.loc[(result["date"] == "2022-11-30T23:00:00.000Z")]