fix(test): data_adapter 测试值修正(range 偏移,4 passed 容器 Python3.10)

This commit is contained in:
2026-07-06 08:04:17 +08:00
parent 41c5e8c359
commit 9b14e34068
+3 -3
View File
@@ -28,7 +28,7 @@ def _make_bar(symbol, dt, close):
def test_convert_bars_to_alpha_df_columns():
"""Test that convert_bars_to_alpha_df produces correct column structure."""
bars = [_make_bar("600000", datetime(2024, 1, i), 10.0 + i) for i in range(1, 6)]
bars = [_make_bar("600000", datetime(2024, 1, i + 1), 10.0 + i) for i in range(5)]
from sanguo_factor.data_adapter import convert_bars_to_alpha_df
df = convert_bars_to_alpha_df(bars)
@@ -41,7 +41,7 @@ def test_convert_bars_to_alpha_df_columns():
def test_convert_bars_to_alpha_df_values():
"""Test that convert_bars_to_alpha_df correctly converts BarData values."""
bars = [_make_bar("600000", datetime(2024, 1, i), 10.0 + i) for i in range(1, 6)]
bars = [_make_bar("600000", datetime(2024, 1, i + 1), 10.0 + i) for i in range(5)]
from sanguo_factor.data_adapter import convert_bars_to_alpha_df
df = convert_bars_to_alpha_df(bars)
@@ -72,7 +72,7 @@ def test_save_alpha_lab_data():
from pathlib import Path
from sanguo_factor.data_adapter import save_alpha_lab_data
bars = [_make_bar("600000", datetime(2024, 1, i), 10.0 + i) for i in range(1, 6)]
bars = [_make_bar("600000", datetime(2024, 1, i + 1), 10.0 + i) for i in range(5)]
with tempfile.TemporaryDirectory() as tmpdir:
lab_path = Path(tmpdir) / "alpha_lab"