diff options
| author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-31 22:01:03 (GMT) |
|---|---|---|
| committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-31 22:01:03 (GMT) |
| commit | 6257a7bbb2660ae75c44f2e71d7ac2ce73900f74 (patch) | |
| tree | 6f010065c95f2d5617f56e07ba2628be21cf9d7a /Lib/test/test_symtable.py | |
| parent | ad5983364966b49c277b495112ae41c6ae2d01ed (diff) | |
| download | cpython-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.zip cpython-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.tar.gz cpython-6257a7bbb2660ae75c44f2e71d7ac2ce73900f74.tar.bz2 | |
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
Diffstat (limited to 'Lib/test/test_symtable.py')
| -rw-r--r-- | Lib/test/test_symtable.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index c9d2054..71994ad 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -3,7 +3,6 @@ Test the API of the symtable module. """ import symtable import unittest -import warnings from test import test_support @@ -44,9 +43,8 @@ def find_block(block, name): class SymtableTest(unittest.TestCase): - with warnings.catch_warnings(): - # Ignore warnings about "from blank import *" - warnings.simplefilter("ignore", SyntaxWarning) + with test_support.check_warnings( + ("import \* only allowed at module level", SyntaxWarning)): top = symtable.symtable(TEST_CODE, "?", "exec") # These correspond to scopes in TEST_CODE Mine = find_block(top, "Mine") |
