Deprecate deprecations as exceptions and friends#12633
Conversation
|
I see the following at the top of my local run though they did not fail the CI. I cannot figure out where they are coming from. Will have to see if they show up in CI too or is it just me. |
|
Mystery warnings also appear in CI but does not fail the tests. |
mhvk
left a comment
There was a problem hiding this comment.
The PR looks good modulo some small nitpicks.
The warnings arise, I think, because the rather old version of pytest_astropy_header imports ignore_warnings (which subclasses from catch_warnings, causing the second warning). We should release a new version!
| def test_wraps(): | ||
| """ | ||
| Tests the compatibility replacement for functools.wraps which supports | ||
| Make sure functools.wraps supports |
There was a problem hiding this comment.
Shouldn't we just delete the test? Not much point testing the python library...
There was a problem hiding this comment.
I don't remember why we had this. I just thought this would at least guard against regression if Python ever changed its behavior in the future. But if no one thinks it is useful, I can remove. Will wait for a second opinion first though.
There was a problem hiding this comment.
Astropy's wraps was removed in #7554 so 👍 with removing the test.
| @@ -0,0 +1,9 @@ | |||
| The following are deprecated and will be removed in a future release. | |||
| Use ``pytest`` warnings handling instead: | |||
There was a problem hiding this comment.
maybe "pytest warning and exception handling"
This comment has been minimized.
This comment has been minimized.
|
It errors on something unrelated: I think this is just a matter of adding making it a raw string, but no idea why this was not caught before!? |
|
Although the regex template should be built with raw strings, there is something else going on beyond that, see #12641 (comment) |
|
I think something in the new Update: Might have to just pin it (#12643) until we can figure out astropy/pytest-astropy-header#41 |
4c2f3be to
6b912be
Compare
|
I guess I'll try my luck with CI again after #12639 ... 😿 |
d7342a3 to
a979b27
Compare
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
since astropy wraps was removed in astropy#7554
a979b27 to
416b6c4
Compare
mhvk
left a comment
There was a problem hiding this comment.
Great! Nice removal of old cruft!
|
Don't forget to stop using these in your downstream packages... 😬 |
|
Let's do this. Thanks for the approvals! I have started attempts to patch downstream packages for the Astropy Coordinated Packages, infrastrucuture-related packages, and those relevant to my own projects. As for the rest, hopefully people pay attention to deprecation warnings and test their stuff against astropy dev. 🤞 |
Manual backport of non-controversial parts from #12633
Description
This pull request is to deprecate and remove some old code from core testing infrastructure. I think these should all go together, as it would be more confusing to do them one at a time. 🔥 🔥 🔥
astropy.io.ascii.tests.common.raisespytest.raisesastropy.tests.helper.raisespytest.raisesastropy.tests.helper.catch_warningspytest.warnsastropy.tests.helper.ignore_warningsastropy.tests.helper.enable_deprecations_as_exceptionsastropy.tests.helper.treat_deprecations_as_exceptionsastropy.tests.disable_internetpytest_remotedata.disable_internetastropy.tests.helper.remote_datapytest.mark.remote_dataastropy.tests.plugins.displaypytest-astropy-headerpackageChecklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.