[Python-checkins] python/dist/src/Lib/test test_doctest.py, 1.19, 1.20

edloper at users.sourceforge.net edloper at users.sourceforge.net
Thu Aug 12 04:41:32 CEST 2004


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

Modified Files:
	test_doctest.py 
Log Message:
- Changed output of DocTestParser.get_program() to make it easier to 
  visually distinguish the expected output from the comments (use 
  "##" to mark expected outputs, and "#" to mark comments).
- If the string given to DocTestParser.get_program() is indented, then
  strip its indentation.  (In particular, find the min indentation of
  non-blank lines, and strip that indentation from all lines.)


Index: test_doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** test_doctest.py	12 Aug 2004 02:34:27 -0000	1.19
--- test_doctest.py	12 Aug 2004 02:41:30 -0000	1.20
***************
*** 1054,1064 ****
      >>> name = 'test.test_doctest.sample_func'
      >>> print doctest.testsource(test.test_doctest, name)
!     #      Blah blah
      #
      print sample_func(22)
      # Expected:
!     #     44
      #
!     #      Yee ha!
  
      >>> name = 'test.test_doctest.SampleNewStyleClass'
--- 1054,1064 ----
      >>> name = 'test.test_doctest.sample_func'
      >>> print doctest.testsource(test.test_doctest, name)
!     # Blah blah
      #
      print sample_func(22)
      # Expected:
!     ## 44
      #
!     # Yee ha!
  
      >>> name = 'test.test_doctest.SampleNewStyleClass'
***************
*** 1066,1072 ****
      print '1\n2\n3'
      # Expected:
!     #     1
!     #     2
!     #     3
  
      >>> name = 'test.test_doctest.SampleClass.a_classmethod'
--- 1066,1072 ----
      print '1\n2\n3'
      # Expected:
!     ## 1
!     ## 2
!     ## 3
  
      >>> name = 'test.test_doctest.SampleClass.a_classmethod'
***************
*** 1074,1081 ****
      print SampleClass.a_classmethod(10)
      # Expected:
!     #     12
      print SampleClass(0).a_classmethod(10)
      # Expected:
!     #     12
  """
  
--- 1074,1081 ----
      print SampleClass.a_classmethod(10)
      # Expected:
!     ## 12
      print SampleClass(0).a_classmethod(10)
      # Expected:
!     ## 12
  """
  



More information about the Python-checkins mailing list