Raise coverage threshold to 95% and expand test coverage

- pyproject.toml: fail_under 80 → 95
- test_alpha: +79 lines
- test_cli_workflow: +226 lines
- test_derived: +121 lines
- test_downloader_contracts: +169 lines
- test_features: +16 lines
- test_minute_downloader: +81 lines
- test_portfolio: +208 lines
This commit is contained in:
Yuxuan Yan
2026-06-16 21:10:30 +08:00
parent b5c8c0b8da
commit 528620b271
8 changed files with 898 additions and 4 deletions
+16
View File
@@ -7,6 +7,7 @@ import pandas as pd
import pytest
from pipeline.features.compute import compute_feature, validate_feature_frame
from pipeline.features.compute import read_feature_frames
from pipeline.features.library.minute_daily_summary import MinuteDailySummaryFeature
from pipeline.features.registry import (
available_features,
@@ -99,6 +100,21 @@ def test_legacy_feature_compute_matches_canonical_derived_compute():
pd.testing.assert_frame_equal(legacy_feature, canonical_derived)
def test_read_feature_frames_delegates_to_derived_validation(tmp_path):
feature = pd.DataFrame({
"symbol_id": ["sh600000"],
"date": ["2024-01-02 15:00:00"],
"toy_feature": [1.5],
})
feature_path = tmp_path / "feature.pq"
feature.to_parquet(feature_path, index=False)
[result] = read_feature_frames([feature_path])
assert result["date"].tolist() == [pd.Timestamp("2024-01-02")]
assert result["toy_feature"].tolist() == [1.5]
def test_load_external_feature_module_and_filter_params(tmp_path):
module_path = tmp_path / "external_feature.py"
module_path.write_text(textwrap.dedent('''