- 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
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 @@
... '''
>>> 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 @@
14
Got:
12
- Trying: x/2
- Expecting: 6
+ Trying:
+ x/2
+ Expecting:
+ 6
ok
(1, 3)
"""
@@ -624,14 +629,19 @@
>>> 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 @@
>>> # 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 @@
... '''
>>> 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)