def test_calculate_financials(summary_df, econ_df, discountto, expected_results): """Parametrized testing of presentvalue computations from dataframes""" pv_df = presentvalue.calc_presentvalue_df(summary_df, econ_df, discountto) fin = presentvalue.calculate_financials(pv_df, 3000) for key, value in expected_results.items(): assert np.isclose(fin[key], value)
def test_calc_presentvalue_df(summary_df, econ_df, discountto, expected_value): """Parametrized testing of presentvalue computations from dataframes""" pv_df = presentvalue.calc_presentvalue_df(summary_df, econ_df, discountto) print(pv_df) assert pv_df["presentvalue"].sum() == expected_value