Message261718
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. |
|
Date |
User |
Action |
Args |
2016-03-14 03:04:03 | rbcollins | set | recipients:
+ rbcollins, ezio.melotti, michael.foord, sleepycal, superluser |
2016-03-14 03:04:03 | rbcollins | set | messageid: <1457924643.14.0.246602844898.issue24922@psf.upfronthosting.co.za> |
2016-03-14 03:04:03 | rbcollins | link | issue24922 messages |
2016-03-14 03:04:02 | rbcollins | create | |
|