Skip to content

Commit e2449f5

Browse files
committed
test: update test_initial_investment_pv_and_fv
1 parent 5627d8c commit e2449f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/portfolio/test_cashflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def test_initial_investment_pv_and_fv(dcf_percentage_halfyear):
128128
dcf = dcf_percentage_halfyear
129129
dcf.discount_rate = 0.10
130130
dcf.mc.period = 5
131+
# PV at the beginning of the historical period
131132
assert dcf.initial_investment_pv == dcf.wealth_index(discounting="pv", include_negative_values=False).iloc[0, 0]
132-
# FV at end of forecast period
133-
expected_fv = dcf.cashflow_parameters.initial_investment * (1 + dcf.discount_rate)**dcf.mc.period
134-
assert dcf.initial_investment_fv == pytest.approx(expected_fv, rel=1e-12)
133+
# FV at the beginning of the historical period
134+
assert dcf.initial_investment_fv == dcf.wealth_index(discounting="fv", include_negative_values=False).iloc[0, 0]
135135

136136

137137
def test_wealth_index_pv_less_than_fv(dcf_indexation_yearly):

0 commit comments

Comments
 (0)