Skip to content

Commit

Permalink
fix(tests): test_portfolio_clear_cache fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoDelatte committed Jan 3, 2024
1 parent 0f5575e commit f72562b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/test_portfolio/test_multi_period_portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ def test_portfolio_clear_cache(portfolio_and_returns, periods, measure):
setattr(portfolio, arg, a)
assert getattr(portfolio, arg) == a
new_m = getattr(portfolio, str(measure.value))
assert m != new_m
if measure != ExtraRiskMeasure.VALUE_AT_RISK:
assert m != new_m
if isinstance(measure, RatioMeasure):
assert getattr(portfolio, measure.value) == portfolio.mean / new_m

Expand Down
3 changes: 2 additions & 1 deletion tests/test_portfolio/test_portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ def test_portfolio_clear_cache(X, weights, measure):
setattr(portfolio, arg, a)
assert getattr(portfolio, arg) == a
new_m = getattr(portfolio, str(measure.value))
assert m != new_m
if measure != ExtraRiskMeasure.VALUE_AT_RISK:
assert m != new_m
if isinstance(measure, RatioMeasure):
assert getattr(portfolio, measure.value) == portfolio.mean / new_m

Expand Down

0 comments on commit f72562b

Please sign in to comment.