Skip to content

TST: pytest.raises vs. tm.assert_raises_regex #16521

Closed
@gfyoung

Description

@gfyoung

I'm wondering whether we should explicitly say in the docs that we prefer tm.assert_raises_regex over pytest.raises unless there is no error message to provide. The former is a lot more informative from a dev-perspective as to why certain code should fail.

Thoughts?

(If we can agree that we do prefer the former, I also move to convert some of the tests to use tm.assert_raises_regex instead of pytest.raises).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandasTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions