#37072: assertWarnsMessage() also ignores entire warning category
-----------------------------------+--------------------------------------
Reporter: Mike Edmunds | Owner: (none)
Type: Bug | Status: new
Component: Testing framework | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by Mike Edmunds):
Here's a test case that could be added to tests/test_utils/tests.py to
verify a fix:
{{{#!python
class AssertWarnsMessageTests(SimpleTestCase):
...
def test_does_not_ignore_entire_category(self):
with (
self.assertRaisesMessage(RemovedInNextVersionWarning,
"Unexpected"),
self.assertWarnsMessage(RemovedInNextVersionWarning,
"Expected"),
):
warnings.warn("Expected", RemovedInNextVersionWarning)
warnings.warn("Unexpected", RemovedInNextVersionWarning)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/37072#comment:1>
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/0107019dd0d7b9d3-c06b9d4d-830b-43ba-b8eb-78584a6d28d9-000000%40eu-central-1.amazonses.com.