()
| 147 | |
| 148 | |
| 149 | def test_portfolio_fixture_smoke(): |
| 150 | prices = _load_fixture_prices() |
| 151 | ivp = openquant.portfolio.allocate_inverse_variance(prices) |
| 152 | mv = openquant.portfolio.allocate_min_vol(prices) |
| 153 | msr = openquant.portfolio.allocate_max_sharpe(prices, risk_free_rate=0.0) |
| 154 | |
| 155 | for out in (ivp, mv, msr): |
| 156 | weights, risk, port_ret, sharpe = out |
| 157 | assert len(weights) == 3 |
| 158 | assert sum(weights) == pytest.approx(1.0, abs=1e-6) |
| 159 | assert isinstance(risk, float) |
| 160 | assert isinstance(port_ret, float) |
| 161 | assert isinstance(sharpe, float) |
| 162 | |
| 163 | |
| 164 | def test_portfolio_rejects_ragged_matrix(): |
nothing calls this directly
no test coverage detected