#37072: assertWarnsMessage() also ignores entire warning category
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: Artyom
| Kotovskiy
Type: Bug | Status: assigned
Component: Testing framework | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mike Edmunds):
Python unittest's `assertWarnsRegex()` has the same (problematic)
behavior: https://github.com/python/cpython/issues/143231. And a comment
in that issue proposes a similar fix to the one I described above for
Django's `assertWarnsMessage()`.
In some local experimentation, there are a handful of existing Django
tests that unintentionally depend on the current behavior and would need
to be updated (e.g., by adding appropriate `ignore_warnings()` for the
non-matching deprecation messages those tests don't care about).
There also seem to be a handful of existing Django tests that
''intentionally'' depend on `assertWarnsMessage()` capturing ''multiple''
instances of the same message. (So the answer to my question in
`test_duplicate_warnings_should_maybe_also_error()` above is: duplicate
warnings should ''not'' error, at least not by default.)
--
Ticket URL: <https://code.djangoproject.com/ticket/37072#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019ddfcdcf30-d8303383-9eee-4190-b721-31d51680c6db-000000%40eu-central-1.amazonses.com.