def test_npv(data, expected): result = npv(*data) if isinstance(result, str): assert result == expected else: assert result == pytest.approx(expected, rel=1e-3)