[Python-checkins] python/dist/src/Lib/test test_doctest.py, 1.31, 1.32

edloper at users.sourceforge.net edloper at users.sourceforge.net
Thu Aug 26 03:19:53 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15972/dist/src/Lib/test

Modified Files:
	test_doctest.py 
Log Message:
- 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


Index: test_doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- test_doctest.py	26 Aug 2004 00:05:43 -0000	1.31
+++ test_doctest.py	26 Aug 2004 01:19:50 -0000	1.32
@@ -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)



More information about the Python-checkins mailing list