(max_rows: int = 64, symbols=("EEM", "EWG", "TIP"))
| 7 | |
| 8 | |
| 9 | def _load_fixture_prices(max_rows: int = 64, symbols=("EEM", "EWG", "TIP")): |
| 10 | fixture_path = ( |
| 11 | Path(__file__).resolve().parents[2] |
| 12 | / "tests" |
| 13 | / "fixtures" |
| 14 | / "portfolio_optimization" |
| 15 | / "stock_prices.csv" |
| 16 | ) |
| 17 | rows = [] |
| 18 | with fixture_path.open("r", newline="") as f: |
| 19 | reader = csv.DictReader(f) |
| 20 | for i, row in enumerate(reader): |
| 21 | rows.append([float(row[s]) for s in symbols]) |
| 22 | if i + 1 >= max_rows: |
| 23 | break |
| 24 | return rows |
| 25 | |
| 26 | |
| 27 | def test_risk_metrics_smoke(): |
no test coverage detected