mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Merged revisions 77942,79023 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77942 | ezio.melotti | 2010-02-03 07:37:26 +0200 (Wed, 03 Feb 2010) | 1 line #7092: Silence more py3k warnings. Patch by Florent Xicluna. ........ r79023 | ezio.melotti | 2010-03-17 15:52:48 +0200 (Wed, 17 Mar 2010) | 1 line #7092: silence some more py3k warnings. ........
This commit is contained in:
parent
5ff2745fed
commit
3efafd7749
41 changed files with 143 additions and 108 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
|
||||
|
@ -104,7 +104,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