diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-09-09 00:49:16 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-09-09 00:49:16 +0000 |
commit | 672237dc6ca1498eabac08554bcbc5bd0fd9ddaa (patch) | |
tree | 1847849ac1bcb31cc345ad691242d846350097d6 /Lib/test/test_symtable.py | |
parent | 631be01252d99e14ec8632ccb6ee898d11345d22 (diff) | |
download | cpython-git-672237dc6ca1498eabac08554bcbc5bd0fd9ddaa.tar.gz |
warnings.catch_warnings() now returns a list or None instead of the custom
WarningsRecorder object. This makes the API simpler to use as no special object
must be learned.
Closes issue 3781.
Review by Benjamin Peterson.
Diffstat (limited to 'Lib/test/test_symtable.py')
-rw-r--r-- | Lib/test/test_symtable.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index 05b237a97a..b20f2b4e0e 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -44,7 +44,7 @@ def find_block(block, name): class SymtableTest(unittest.TestCase): - with test_support.catch_warning(record=False): + with warnings.catch_warnings(): # Ignore warnings about "from blank import *" warnings.simplefilter("ignore", SyntaxWarning) top = symtable.symtable(TEST_CODE, "?", "exec") @@ -60,16 +60,16 @@ class SymtableTest(unittest.TestCase): def check(w, msg): self.assertEqual(str(w.message), msg) sym = self.top.lookup("glob") - with test_support.catch_warning() as w: + with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always", DeprecationWarning) self.assertFalse(sym.is_vararg()) - check(w, "is_vararg() is obsolete and will be removed") - w.reset() + check(w[-1].message, "is_vararg() is obsolete and will be removed") self.assertFalse(sym.is_keywordarg()) - check(w, "is_keywordarg() is obsolete and will be removed") - w.reset() + check(w[-1].message, + "is_keywordarg() is obsolete and will be removed") self.assertFalse(sym.is_in_tuple()) - check(w, "is_in_tuple() is obsolete and will be removed") + check(w[-1].message, + "is_in_tuple() is obsolete and will be removed") def test_type(self): self.assertEqual(self.top.get_type(), "module") |