summaryrefslogtreecommitdiff
path: root/Lib/test/test_symtable.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2008-09-11 12:11:06 +0000
committerNick Coghlan <ncoghlan@gmail.com>2008-09-11 12:11:06 +0000
commitd2e09383624944add0e670b857c572129d56988e (patch)
treef77e6631636c1d33d9bd5cf1e3e905c571ac9cd9 /Lib/test/test_symtable.py
parent9fa5a2828c8007dfb678b883d65aecac93e995e4 (diff)
downloadcpython-git-d2e09383624944add0e670b857c572129d56988e.tar.gz
Issue #3781: Final cleanup of warnings.catch_warnings and its usage in the test suite. Closes issue w.r.t. 2.6 (R: Brett Cannon)
Diffstat (limited to 'Lib/test/test_symtable.py')
-rw-r--r--Lib/test/test_symtable.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index b20f2b4e0e..f1fa18ac92 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -60,16 +60,16 @@ class SymtableTest(unittest.TestCase):
def check(w, msg):
self.assertEqual(str(w.message), msg)
sym = self.top.lookup("glob")
- with warnings.catch_warnings(record=True) as w:
+ with test_support.check_warnings() as w:
warnings.simplefilter("always", DeprecationWarning)
self.assertFalse(sym.is_vararg())
- check(w[-1].message, "is_vararg() is obsolete and will be removed")
+ check(w, "is_vararg() is obsolete and will be removed")
+ w.reset()
self.assertFalse(sym.is_keywordarg())
- check(w[-1].message,
- "is_keywordarg() is obsolete and will be removed")
+ check(w, "is_keywordarg() is obsolete and will be removed")
+ w.reset()
self.assertFalse(sym.is_in_tuple())
- check(w[-1].message,
- "is_in_tuple() is obsolete and will be removed")
+ check(w, "is_in_tuple() is obsolete and will be removed")
def test_type(self):
self.assertEqual(self.top.get_type(), "module")