mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Merged revisions 79049 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79049 | florent.xicluna | 2010-03-18 20:51:47 +0100 (jeu, 18 mar 2010) | 2 lines #8155: Preserve backward compatibility for test_support.check_warnings(). Add regression tests. ........
This commit is contained in:
parent
7fb4da7650
commit
53b506beda
3 changed files with 84 additions and 62 deletions
|
@ -534,14 +534,19 @@ def check_warnings(*filters, **kwargs):
|
|||
|
||||
Optional argument:
|
||||
- if 'quiet' is True, it does not fail if a filter catches nothing
|
||||
(default False)
|
||||
(default True without argument,
|
||||
default False if some filters are defined)
|
||||
|
||||
Without argument, it defaults to:
|
||||
check_warnings(("", Warning), quiet=False)
|
||||
check_warnings(("", Warning), quiet=True)
|
||||
"""
|
||||
quiet = kwargs.get('quiet')
|
||||
if not filters:
|
||||
filters = (("", Warning),)
|
||||
return _filterwarnings(filters, kwargs.get('quiet'))
|
||||
# Preserve backward compatibility
|
||||
if quiet is None:
|
||||
quiet = True
|
||||
return _filterwarnings(filters, quiet)
|
||||
|
||||
|
||||
class CleanImport(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue