Skip to content

test_n_periods uses return instead of assert #743

@SaguaroDev

Description

@SaguaroDev

Description

chainladder/development/tests/test_development.py::test_n_periods (line 40) ends with return xp.all(...) instead of assert xp.all(...). Pytest 9 emits a PytestReturnNotNoneWarning for this:

PytestReturnNotNoneWarning: Test functions should return None, but
chainladder/development/tests/test_development.py::test_n_periods returned <class 'numpy.bool'>.
Did you mean to use `assert` instead of `return`?

More importantly, the test currently does not actually fail when the equality breaks — it just returns a bool that pytest discards. This silently masks regressions in Development(n_periods=3, average='volume').

Reproduction

uv run pytest chainladder/development/tests/test_development.py::test_n_periods -W error::pytest.PytestReturnNotNoneWarning

Proposed fix

One-line change: replace return with assert on line 43. Outside the scope of #664 / #729 (this is a pytest issue, not a pandas 3.0 issue).

Note

This is the only test in the package with this bug — I grepped ^ return in test_*.py and the other 5 matches are all legitimate fixture returns. Happy to put up a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort > Brief 🐇Small tasks expected to take a few hours up to a couple of days.Great First Contribution! 🌱Beginner friendly tickets with narrow scope and huge impact. Perfect to join our community!Impact > Minor 🔷Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions