This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rbcollins
Recipients ezio.melotti, michael.foord, rbcollins, sleepycal, superluser
Date 2016-03-14.03:04:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457924643.14.0.246602844898.issue24922@psf.upfronthosting.co.za>
In-reply-to
Content
The context manager errors if *nothing* matches, not if *everything* matches, which is very different to catch_warnings because the filters are used to *exclude* warnings, and excess warnings are errors there.

Because of that, there's little if any reason to add support for multiple regexes - just nest two context managers.

That said...

The lineno is already not-fully-informative - its the first matching warnings lineno.

Right now, the definition in the code is:

for warnings in (the warning item-or-tuple)
 if the regex matches, done

if none of the warnings match, error.

If we allow the tuple of warnings to be a tuple of (warning, regex) items, we could do that compatibly, with some introspection.

If the patch is fairly small, It might be ok, for all that I don't see a need for it.
History
Date User Action Args
2016-03-14 03:04:03rbcollinssetrecipients: + rbcollins, ezio.melotti, michael.foord, sleepycal, superluser
2016-03-14 03:04:03rbcollinssetmessageid: <1457924643.14.0.246602844898.issue24922@psf.upfronthosting.co.za>
2016-03-14 03:04:03rbcollinslinkissue24922 messages
2016-03-14 03:04:02rbcollinscreate