Skip to content

We need more thorough test coverage #58

Open

Description

@Kai-Striega

Our tests for many of the functions are very sparse, this should be updated to include more tests for each of the functions in numpy-financial. In particular, I think we need more thorough testing of edge cases.

The test can be modified by editing test_financial.py.

Activity

  1. Kai-Striega commented on Oct 23, 2022

    @Kai-Striega
    MemberAuthor

    @jdilanzo I think you might be interested in this

  2. jlopezpena commented on Mar 13, 2023

    @jlopezpena
    Contributor

    Financial math functions are very amenable to property based testing, which excels at finding edge cases. Would it be acceptable to add a dev/test dependency on hypothesis? If so, I can give a hand at designing sampling strategies and property based tests.

  3. Kai-Striega commented on Mar 14, 2023

    @Kai-Striega
    MemberAuthor

    Hypothesis looks like a great addition. I'm happy to add it as a dev dependency. I don't have much experience with hypothesis, although I've been meaning to try it out for a while. So I might need a wile to get up to speed

  4. Kai-Striega commented on Jul 12, 2023

    @Kai-Striega
    MemberAuthor

    @kalicialopez You might be interested in this :)

  5. added this to the 2.0 milestone on Nov 11, 2023
  6. Kai-Striega commented on Nov 13, 2023

    @Kai-Striega
    MemberAuthor

    I've been thinking about this some more and, at a minimum, I'd like to confirm each function:

    • Supports decimal.Decimal type
    • Supports broadcasting behaviour

    I'm also amicable to using hypothesis as suggested earlier

  7. 0xs1d commented on May 24, 2025

    @0xs1d

    Hi, is this issue still active? Can I help with this?

  8. immortal71 commented on Nov 16, 2025

    @immortal71

    @Kai-Striega Hi! I’d like to help improve the test coverage for numpy-financial. Is anyone currently working on this, or can I get started?
    If you have any specific functions or edge cases you’d like me to focus on, please let me know. Thanks!

  9. tylerdegroff commented on Nov 17, 2025

    @tylerdegroff

    @Kai-Striega Also happy to contribute to test coverage.

  10. Eshan-kumar-jain commented on Sep 24, 2026

    @Eshan-kumar-jain

    Hi my name is Eshan, I’d like to work on this issue. I’ll begin by adding edge‑case tests for npv, irr, and pmt (e.g. zero discount rates, all‑negative cash flows, no sign change in cash flows, zero interest rates). Once those are in place I’ll look at the other functions. I’ll open a draft PR once the first set of tests is ready, and I’m happy to take feedback on which edge cases matter most.

  11. Eshan-kumar-jain commented on Sep 24, 2026

    @Eshan-kumar-jain

    Opened #155 with edge case tests for npv and irr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for beginners or newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions