Opened 10 years ago
Closed 10 years ago
#24036 closed New feature (fixed)
Ignore deprecation warnings in tests depending on the Django version
Reported by: | Aymeric Augustin | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
We used to replace all PendingDeprecationWarning
with DeprecationWarning
after each release. We introduced RemovedInDjangoXYWarning
to solve this problem.
We're still replacing IgnorePendingDeprecationWarningsMixin
with IgnoreDeprecationWarningsMixin
. We should introduce a similar solution.
Change History (5)
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 10 years ago
Has patch: | set |
---|
See https://github.com/django/django/pull/3771, does that look like what you had in mind?
comment:3 by , 10 years ago
On the one hand, I like that the current scheme is very explicit in that we put only the code which raises the warning in a catch_warnings()
block. On the other hand it's very verbose, error-prone, and sometimes confusing to new contributors. The decorator syntax seems very nice and it seems great to standardize the method used on classes and methods so +1 from me if there are no other objections.
comment:4 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
commit 51890ce8898f821d28f2f6fb6071c936e9bd88f0 Author: Claude Paroz <claude@2xlibre.net> Date: Sun Dec 21 21:19:05 2014 +0100 Applied ignore_warnings to Django tests commit 66f9a74b4514bd259976ce8ee3a4e78288358a5f Author: Claude Paroz <claude@2xlibre.net> Date: Sun Dec 21 21:13:06 2014 +0100 Added ignore_warnings decorator And removed Ignore*DeprecationWarningsMixin, now obsolete. Thanks Berker Peksag and Tim Graham for the review.
I'll try to have a look at it.