Skip to content

Should avoid global seterr calls in test files #13650

@jnothman

Description

@jnothman

From #5664 (comment), there are global seterr in test files:

sklearn/neural_network/tests/test_mlp.py:np.seterr(all='warn')
sklearn/neural_network/tests/test_rbm.py:np.seterr(all='warn')

Having this set globally affects other test files, and does not necessarily set the error state for the tests in that file. We should instead use a fixture to enable warnings, or use errstate in tests that need it.

On the other hand, we should consider investigating and avoiding these numpy errors where possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EasyWell-defined and straightforward way to resolvehelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions