diff options
author | Edward Loper <edloper@gradient.cis.upenn.edu> | 2004-08-26 01:19:50 (GMT) |
---|---|---|
committer | Edward Loper <edloper@gradient.cis.upenn.edu> | 2004-08-26 01:19:50 (GMT) |
commit | aacf0833886c30f900fe18db1367d887cc0d1172 (patch) | |
tree | 70d0b7a8b49702b132a93b4d6e8cc8078d1ab2fc /Lib/test/test_doctest.py | |
parent | 0e448073d6afed4806a8dbd3261057a681023993 (diff) | |
download | cpython-aacf0833886c30f900fe18db1367d887cc0d1172.zip cpython-aacf0833886c30f900fe18db1367d887cc0d1172.tar.gz cpython-aacf0833886c30f900fe18db1367d887cc0d1172.tar.bz2 |
- Changed the output of report_start() and report_unexpected_exception()
to be more consistent with report_failure()
- If `want` or `got` is empty, then print "Expected nothing\n" or
"Got nothing\n" rather than "Expected:\n" or "Got:\n"
- Got rid of _tag_msg
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r-- | Lib/test/test_doctest.py | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index a9076a6..7884c04 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -591,11 +591,14 @@ the failure and proceeds to the next example: ... ''' >>> test = doctest.DocTestFinder().find(f)[0] >>> doctest.DocTestRunner(verbose=True).run(test) - Trying: x = 12 - Expecting: nothing + Trying: + x = 12 + Expecting nothing ok - Trying: print x - Expecting: 14 + Trying: + print x + Expecting: + 14 ********************************************************************** Line 3, in f Failed example: @@ -604,8 +607,10 @@ the failure and proceeds to the next example: 14 Got: 12 - Trying: x/2 - Expecting: 6 + Trying: + x/2 + Expecting: + 6 ok (1, 3) """ @@ -624,14 +629,19 @@ output: >>> test = doctest.DocTestFinder().find(f)[0] >>> doctest.DocTestRunner(verbose=True).run(test) - Trying: x = 12 - Expecting: nothing + Trying: + x = 12 + Expecting nothing ok - Trying: print x - Expecting: 12 + Trying: + print x + Expecting: + 12 ok - Trying: x/2 - Expecting: 6 + Trying: + x/2 + Expecting: + 6 ok (0, 3) @@ -649,14 +659,19 @@ iff `-v` appears in sys.argv: >>> # If -v does appear in sys.argv, then output is verbose. >>> sys.argv = ['test', '-v'] >>> doctest.DocTestRunner().run(test) - Trying: x = 12 - Expecting: nothing + Trying: + x = 12 + Expecting nothing ok - Trying: print x - Expecting: 12 + Trying: + print x + Expecting: + 12 ok - Trying: x/2 - Expecting: 6 + Trying: + x/2 + Expecting: + 6 ok (0, 3) @@ -1633,11 +1648,14 @@ def old_test2(): r""" ... ''' >>> t.runstring(test, "Example") Running string Example - Trying: x = 1 + 2 - Expecting: nothing + Trying: + x = 1 + 2 + Expecting nothing ok - Trying: x - Expecting: 3 + Trying: + x + Expecting: + 3 ok 0 of 2 examples failed in string Example (0, 2) |