diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-21 01:14:24 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-21 01:14:24 (GMT) |
commit | 07627880813ffaad8d9b90bfe8791ccf588b031b (patch) | |
tree | 14fbe48b451085257da7c79781999cc86729c74f /Lib/test/test_doctest.py | |
parent | 8cb253f8d6333af0a575d5951379c090752c0fc6 (diff) | |
download | cpython-07627880813ffaad8d9b90bfe8791ccf588b031b.zip cpython-07627880813ffaad8d9b90bfe8791ccf588b031b.tar.gz cpython-07627880813ffaad8d9b90bfe8791ccf588b031b.tar.bz2 |
#7092 - Silence more py3k deprecation warnings, using test_support.check_py3k_warnings() helper.
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r-- | Lib/test/test_doctest.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 426b33f..faa99ac 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -2169,7 +2169,7 @@ We don't want `-v` in sys.argv for these tests. >>> doctest.master = None # Reset master. (Note: we'll be clearing doctest.master after each call to -`doctest.testfile`, to supress warnings about multiple tests with the +`doctest.testfile`, to suppress warnings about multiple tests with the same name.) Globals may be specified with the `globs` and `extraglobs` parameters: @@ -2333,12 +2333,6 @@ bothering with the current sys.stdout encoding. # that these use the deprecated doctest.Tester, so should go away (or # be rewritten) someday. -# Ignore all warnings about the use of class Tester in this module. -# Note that the name of this module may differ depending on how it's -# imported, so the use of __name__ is important. -warnings.filterwarnings("ignore", "class Tester", DeprecationWarning, - __name__, 0) - def old_test1(): r""" >>> from doctest import Tester >>> t = Tester(globs={'x': 42}, verbose=0) @@ -2462,9 +2456,16 @@ def old_test4(): """ def test_main(): # Check the doctest cases in doctest itself: test_support.run_doctest(doctest, verbosity=True) - # Check the doctest cases defined here: + from test import test_doctest - test_support.run_doctest(test_doctest, verbosity=True) + with test_support.check_py3k_warnings( + ("backquote not supported", SyntaxWarning), + ("execfile.. not supported", DeprecationWarning)): + # Ignore all warnings about the use of class Tester in this module. + warnings.filterwarnings("ignore", "class Tester is deprecated", + DeprecationWarning) + # Check the doctest cases defined here: + test_support.run_doctest(test_doctest, verbosity=True) import trace, sys def test_coverage(coverdir): |