diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-06-24 06:29:21 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-06-24 06:29:21 (GMT) |
commit | a67d78e50c02ea3a5605d2e8103342b314bfece7 (patch) | |
tree | d32347940043e94b89a086f15993276100137fd6 /Lib/test/test_doctest.py | |
parent | 69da9c43431a107f4386d18d18cf08725b3659e6 (diff) | |
parent | e495646a9702935ae47f01c4fd06b62328bf11cb (diff) | |
download | cpython-a67d78e50c02ea3a5605d2e8103342b314bfece7.zip cpython-a67d78e50c02ea3a5605d2e8103342b314bfece7.tar.gz cpython-a67d78e50c02ea3a5605d2e8103342b314bfece7.tar.bz2 |
Issue #18300: Merge from 3.5
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r-- | Lib/test/test_doctest.py | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index ec12fe7..b416cbb 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -2718,12 +2718,6 @@ output into something we can doctest against: >>> def normalize(s): ... return '\n'.join(s.decode().splitlines()) -Note: we also pass TERM='' to all the assert_python calls to avoid a bug -in the readline library that is triggered in these tests because we are -running them in a new python process. See: - - http://lists.gnu.org/archive/html/bug-readline/2013-06/msg00000.html - With those preliminaries out of the way, we'll start with a file with two simple tests and no errors. We'll run both the unadorned doctest command, and the verbose version, and then check the output: @@ -2740,9 +2734,9 @@ the verbose version, and then check the output: ... _ = f.write('\n') ... _ = f.write('And that is it.\n') ... rc1, out1, err1 = script_helper.assert_python_ok( - ... '-m', 'doctest', fn, TERM='') + ... '-m', 'doctest', fn) ... rc2, out2, err2 = script_helper.assert_python_ok( - ... '-m', 'doctest', '-v', fn, TERM='') + ... '-m', 'doctest', '-v', fn) With no arguments and passing tests, we should get no output: @@ -2804,17 +2798,17 @@ text files). ... _ = f.write("\n") ... _ = f.write(' \"\"\"\n') ... rc1, out1, err1 = script_helper.assert_python_failure( - ... '-m', 'doctest', fn, fn2, TERM='') + ... '-m', 'doctest', fn, fn2) ... rc2, out2, err2 = script_helper.assert_python_ok( - ... '-m', 'doctest', '-o', 'ELLIPSIS', fn, TERM='') + ... '-m', 'doctest', '-o', 'ELLIPSIS', fn) ... rc3, out3, err3 = script_helper.assert_python_ok( ... '-m', 'doctest', '-o', 'ELLIPSIS', - ... '-o', 'NORMALIZE_WHITESPACE', fn, fn2, TERM='') + ... '-o', 'NORMALIZE_WHITESPACE', fn, fn2) ... rc4, out4, err4 = script_helper.assert_python_failure( - ... '-m', 'doctest', '-f', fn, fn2, TERM='') + ... '-m', 'doctest', '-f', fn, fn2) ... rc5, out5, err5 = script_helper.assert_python_ok( ... '-m', 'doctest', '-v', '-o', 'ELLIPSIS', - ... '-o', 'NORMALIZE_WHITESPACE', fn, fn2, TERM='') + ... '-o', 'NORMALIZE_WHITESPACE', fn, fn2) Our first test run will show the errors from the first file (doctest stops if a file has errors). Note that doctest test-run error output appears on stdout, @@ -2920,7 +2914,7 @@ We should also check some typical error cases. Invalid file name: >>> rc, out, err = script_helper.assert_python_failure( - ... '-m', 'doctest', 'nosuchfile', TERM='') + ... '-m', 'doctest', 'nosuchfile') >>> rc, out (1, b'') >>> print(normalize(err)) # doctest: +ELLIPSIS @@ -2931,7 +2925,7 @@ Invalid file name: Invalid doctest option: >>> rc, out, err = script_helper.assert_python_failure( - ... '-m', 'doctest', '-o', 'nosuchoption', TERM='') + ... '-m', 'doctest', '-o', 'nosuchoption') >>> rc, out (2, b'') >>> print(normalize(err)) # doctest: +ELLIPSIS |