mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
#7092: silence some more py3k warnings.
This commit is contained in:
parent
8b3f1ce591
commit
d80b4bfd0b
9 changed files with 84 additions and 56 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue