Skip to content

DEP: deprecate np.testing.dec #18051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 29, 2020
Merged

Conversation

rpolley
Copy link
Contributor

@rpolley rpolley commented Dec 21, 2020

Per #17566 the decorators in numpy.testing.dec are intended for compatibility with the nose testing framework, and should discouraged in the documentation, if not outright deprecated. This pull request updates the documentation of these decorators with a deprecation warning telling people not to use the nose testing framework, adds a deprecation warning to them saying the same, and moves the tests to numpy/core/tests/test_deprecated.py and wraps them in an assert_deprecated check.

Closes: #17566

Since the decorators in np.testing.dec are intended for nose test framework
support, deprecate them by updating the docstring and adding a warning when
they are used on functions
For whatever reason the build system doesn't like the test calls
to warnings.warn with no stacklevel parameter inside the tests
that I moved.
@rgommers
Copy link
Member

This makes sense, it's about time. To be sure, can you please send an email to the numpy-discussion mailing list about this? All deprecations need to go through the mailing list for approval.

@rpolley
Copy link
Contributor Author

rpolley commented Dec 28, 2020

I created a discussion on the mailing list for this pull request.

@mattip
Copy link
Member

mattip commented Dec 28, 2020

@rpolley I am pretty sure we don't install nose for testing, so the moved tests were not actually run before this PR, and are not being run in it. Did you try it to make sure the deprecations work as advertised?

@charris
Copy link
Member

charris commented Dec 28, 2020

we don't install nose for testing

I removed it from the CI testing while back, it used to be there.

@mattip
Copy link
Member

mattip commented Dec 29, 2020

Checked locally, all looks good.

@mattip mattip merged commit 717df4e into numpy:master Dec 29, 2020
@mattip
Copy link
Member

mattip commented Dec 29, 2020

Thanks @rpolley

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

Successfully merging this pull request may close these issues.

DOC: mark np.testing.dec functions as not recommended for future use
4 participants