diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-08-20 01:42:01 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-08-20 01:42:01 +0000 |
commit | e977ad4d7bda48451c70b72b221c9804b353ceb9 (patch) | |
tree | 5fb2d640d3a0d3740e811eb6309d5a8af2a6695d /Lib/test/test_symtable.py | |
parent | f647dc10e339e8f5b2a17d7057f4fba958678d72 (diff) | |
download | cpython-git-e977ad4d7bda48451c70b72b221c9804b353ceb9.tar.gz |
deprecate some useless, noop methods in symtable
Diffstat (limited to 'Lib/test/test_symtable.py')
-rw-r--r-- | Lib/test/test_symtable.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index fc678a84a9..05b237a97a 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -55,6 +55,22 @@ class SymtableTest(unittest.TestCase): internal = find_block(spam, "internal") foo = find_block(top, "foo") + def test_noops(self): + # Check methods that don't work. They should warn and return False. + def check(w, msg): + self.assertEqual(str(w.message), msg) + sym = self.top.lookup("glob") + with test_support.catch_warning() as w: + warnings.simplefilter("always", DeprecationWarning) + self.assertFalse(sym.is_vararg()) + check(w, "is_vararg() is obsolete and will be removed") + w.reset() + self.assertFalse(sym.is_keywordarg()) + check(w, "is_keywordarg() is obsolete and will be removed") + w.reset() + self.assertFalse(sym.is_in_tuple()) + check(w, "is_in_tuple() is obsolete and will be removed") + def test_type(self): self.assertEqual(self.top.get_type(), "module") self.assertEqual(self.Mine.get_type(), "class") |