Robert Collins added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24922>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to