FFFFFFFFFFFFFFFF                                                         [100%]
=================================== FAILURES ===================================
_________________ test_discrete_whole_life_variance[1-0.01-0] __________________

q_text = '0', rate_text = '0.01', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.037497122000504146 == 0.0 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.037497122000504146
E         Expected: 0.0 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[1-0.01-0.25] ________________

q_text = '0.25', rate_text = '0.01', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.033056527632089105 == 1.80183814590...e-05 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.033056527632089105
E         Expected: 1.8018381459052804e-05 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[1-0.01-0.5] _________________

q_text = '0.5', rate_text = '0.01', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.028546325210749512 == 2.40245086120...e-05 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.028546325210749512
E         Expected: 2.4024508612070408e-05 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
_________________ test_discrete_whole_life_variance[1-0.01-1] __________________

q_text = '1', rate_text = '0.01', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.019315704924104615 == 0.0 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.019315704924104615
E         Expected: 0.0 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
_________________ test_discrete_whole_life_variance[1-0.05-0] __________________

q_text = '0', rate_text = '0.05', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.14586311276319486 == 0.0 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.14586311276319486
E         Expected: 0.0 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[1-0.05-0.25] ________________

q_text = '0.25', rate_text = '0.05', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.13246305434448635 == 0.00038564178...6947 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.13246305434448635
E         Expected: 0.0003856417850586947 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[1-0.05-0.5] _________________

q_text = '0.5', rate_text = '0.05', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.11776196393529981 == 0.00051418904...9263 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.11776196393529981
E         Expected: 0.0005141890467449263 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
_________________ test_discrete_whole_life_variance[1-0.05-1] __________________

q_text = '1', rate_text = '0.05', benefit = 1

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 0.08432700366616797 == 0.0 ± 7.1e-15
E         
E         comparison failed
E         Obtained: 0.08432700366616797
E         Expected: 0.0 ± 7.1e-15

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[100-0.01-0] _________________

q_text = '0', rate_text = '0.01', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 374.97122000504146 == 0.0 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 374.97122000504146
E         Expected: 0.0 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
_______________ test_discrete_whole_life_variance[100-0.01-0.25] _______________

q_text = '0.25', rate_text = '0.01', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 330.56527632089103 == 0.18018381459052804 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 330.56527632089103
E         Expected: 0.18018381459052804 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
_______________ test_discrete_whole_life_variance[100-0.01-0.5] ________________

q_text = '0.5', rate_text = '0.01', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 285.4632521074951 == 0.24024508612070408 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 285.4632521074951
E         Expected: 0.24024508612070408 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[100-0.01-1] _________________

q_text = '1', rate_text = '0.01', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 193.15704924104614 == 0.0 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 193.15704924104614
E         Expected: 0.0 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[100-0.05-0] _________________

q_text = '0', rate_text = '0.05', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 1458.6311276319486 == 0.0 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 1458.6311276319486
E         Expected: 0.0 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
_______________ test_discrete_whole_life_variance[100-0.05-0.25] _______________

q_text = '0.25', rate_text = '0.05', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 1324.6305434448636 == 3.8564178505869466 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 1324.6305434448636
E         Expected: 3.8564178505869466 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
_______________ test_discrete_whole_life_variance[100-0.05-0.5] ________________

q_text = '0.5', rate_text = '0.05', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 1177.619639352998 == 5.1418904674492625 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 1177.619639352998
E         Expected: 5.1418904674492625 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
________________ test_discrete_whole_life_variance[100-0.05-1] _________________

q_text = '1', rate_text = '0.05', benefit = 100

    @pytest.mark.parametrize('q_text', ['0', '0.25', '0.5', '1'])
    @pytest.mark.parametrize('rate_text', ['0.01', '0.05'])
    @pytest.mark.parametrize('benefit', [1, 100])
    def test_discrete_whole_life_variance(q_text, rate_text, benefit):
        """A payout at year one or two has the Bernoulli two-point variance."""
        q, rate = Fraction(q_text), Fraction(rate_text)
        v = 1 / (1 + rate)
        expected = q * (1 - q) * (benefit * (v - v * v)) ** 2
        life = LifeTable().set_table(q={40: float(q), 41: 1}).set_interest(i=float(rate))
        actual = life.whole_life_insurance(40, b=benefit, moment=life.VARIANCE)
        tolerance = 32 * sys.float_info.epsilon * benefit ** 2
>       assert actual == pytest.approx(float(expected), rel=0, abs=tolerance)
E       assert 843.2700366616797 == 0.0 ± 7.1e-11
E         
E         comparison failed
E         Obtained: 843.2700366616797
E         Expected: 0.0 ± 7.1e-11

tests/test_whole_life_variance.py:20: AssertionError
=============================== warnings summary ===============================
src/actuarialmath/actuarial.py:8
  /Users/khamit/Documents/Codex/2026-09-14/insurance-invariant-hunt/work/actuarialmath-corrected/src/actuarialmath/actuarial.py:8: DeprecationWarning: scipy.misc is deprecated and will be removed in 2.0.0
    import scipy.misc

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.01-0]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.01-0.25]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.01-0.5]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.01-1]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.05-0]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.05-0.25]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.05-0.5]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[1-0.05-1]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.01-0]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.01-0.25]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.01-0.5]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.01-1]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.05-0]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.05-0.25]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.05-0.5]
FAILED tests/test_whole_life_variance.py::test_discrete_whole_life_variance[100-0.05-1]
16 failed, 1 warning in 1.09s
