Reduce the number of test-suite DeprecationWarnings; start adding
resetwarnings() calls too.
This commit is contained in:
parent
c15acef4a4
commit
f022a4d451
@ -158,3 +158,5 @@ check_all("weakref")
|
|||||||
check_all("webbrowser")
|
check_all("webbrowser")
|
||||||
check_all("xdrlib")
|
check_all("xdrlib")
|
||||||
check_all("zipfile")
|
check_all("zipfile")
|
||||||
|
|
||||||
|
warnings.resetwarnings()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import copy
|
import copy
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
# Fake a number that implements numeric methods through __coerce__
|
# Fake a number that implements numeric methods through __coerce__
|
||||||
class CoerceNumber:
|
class CoerceNumber:
|
||||||
@ -109,5 +110,11 @@ def do_prefix_binops():
|
|||||||
else:
|
else:
|
||||||
print '=', x
|
print '=', x
|
||||||
|
|
||||||
do_infix_binops()
|
warnings.filterwarnings("ignore",
|
||||||
do_prefix_binops()
|
r'complex divmod\(\), // and % are deprecated',
|
||||||
|
DeprecationWarning)
|
||||||
|
try:
|
||||||
|
do_infix_binops()
|
||||||
|
do_prefix_binops()
|
||||||
|
finally:
|
||||||
|
warnings.resetwarnings()
|
||||||
|
@ -16,7 +16,6 @@ testdoc = """\
|
|||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
|
warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
del warnings
|
|
||||||
|
|
||||||
import test_support
|
import test_support
|
||||||
import unittest
|
import unittest
|
||||||
@ -33,6 +32,7 @@ class XMLParserTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
test_support.run_unittest(XMLParserTestCase)
|
test_support.run_unittest(XMLParserTestCase)
|
||||||
|
warnings.resetwarnings()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user