diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-03-17 13:52:48 +0000 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-03-17 13:52:48 +0000 |
commit | d80b4bfd0b291d543c682d7dac0841de0192a238 (patch) | |
tree | 3968f81c285078b86b95aedddc6246f4d901a542 /Lib/test/test_opcodes.py | |
parent | 8b3f1ce5916c3ec5f426d45496b313d7be6ea3a1 (diff) | |
download | cpython-git-d80b4bfd0b291d543c682d7dac0841de0192a238.tar.gz |
#7092: silence some more py3k warnings.
Diffstat (limited to 'Lib/test/test_opcodes.py')
-rw-r--r-- | Lib/test/test_opcodes.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index 77090dab89..c93ef86df2 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -1,6 +1,6 @@ # Python test set -- part 2, opcodes -from test.test_support import run_unittest +from test.test_support import run_unittest, check_py3k_warnings import unittest class OpcodeTest(unittest.TestCase): @@ -9,7 +9,7 @@ class OpcodeTest(unittest.TestCase): n = 0 for i in range(10): n = n+i - try: 1/0 + try: 1 // 0 except NameError: pass except ZeroDivisionError: pass except TypeError: pass @@ -110,7 +110,12 @@ class OpcodeTest(unittest.TestCase): def test_main(): - run_unittest(OpcodeTest) + with check_py3k_warnings(("exceptions must derive from BaseException", + DeprecationWarning), + ("catching classes that don't inherit " + "from BaseException is not allowed", + DeprecationWarning)): + run_unittest(OpcodeTest) if __name__ == '__main__': test_main() |