• Your tests are using the properties of the objects we implement instead of the original values for testing, so it's dependent on us actually using the property names you intended, and doing it genuinely.

    This means that your tests become utterly broken if the properties are assigned with the wrong values by the user, either unintentionally or deliberately. See this.

  • Not sure I'll complete this one... Maybe I'll try later, after a complete reading of the discrouse. But for now: ISSUE! ISSUE! ;)

    Traceback:
       in <module>
       in all_tests
    AttributeError: 'Person' object has no attribute 'withdrawal_rate'
    

    If you want to test specifically the properties of a Person object, you have to give the exact spelling you want for them. Either by putting them in the solution setup or by saying it in the description ith the appropriate formatting: "...name, ...age,...withdrawal_rate, ...". Or even by creating getters in the solution setup that the warrior will have to complete the way he wants.

    About the market... function, you have to tell if the result is a purcentage (and the kind of it: +1% or *101%) or a "normal" coefficient (*1.01).

  • It's really unclear what should be done.

    • Parameter month in market_rate_function, is it 0-indexed or 1-indexed?
    • What does the result of market_rate_function mean? Is it a percentage rate? How to calculate, like new = old * (1 + rate / 100)?
    • What should the result of market_rate_function be applied to? Withdraw amount? Portfolio? Both?
    • And most importantly, what is the whole process? The given link seems not contains a complete specification, detailed something like when the 4% rate should be applied.

    There are even not a wiki page about this planning system. I found a related link.
    It says

    For example, you retire with $700,000 in your portfolio. In your first year of retirement, you withdraw $28,000. ($700,000 x 0.04 equals $28,000.)

    The following year you withdraw the same amount, adjusted for inflation. Assuming 3 percent inflation, you should withdraw $28,840. ($28,000 x 1.03 equals $28,840.)

    The $28,840 figure might be more than 4 percent of your remaining portfolio, depending on how the markets fluctuated during your first year of retirement. Don't worry about that — you only need to calculate 4 percent once. The guideline says you should withdraw 4 percent during your first year of retirement, and continue withdrawing the same amount, adjusted for inflation, each year after that.

    But is it the system used in this kata?