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

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


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

Modified Files:
	test_doctest.py 
Log Message:
- Added __docformat__
- Added comments for some regexps
- If the traceback type/message don't match, then still print full
  traceback in report_failure (not just the first & last lines)
- Renamed DocTestRunner.__failure_header -> _failure_header


Index: test_doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** test_doctest.py	12 Aug 2004 02:27:44 -0000	1.18
--- test_doctest.py	12 Aug 2004 02:34:27 -0000	1.19
***************
*** 270,277 ****
      >>> finder = doctest.DocTestFinder()
      >>> tests = finder.find(sample_func)
!     
      >>> print tests  # doctest: +ELLIPSIS
      [<DocTest sample_func from ...:12 (1 example)>]
!     
      >>> e = tests[0].examples[0]
      >>> (e.source, e.want, e.lineno)
--- 270,277 ----
      >>> finder = doctest.DocTestFinder()
      >>> tests = finder.find(sample_func)
! 
      >>> print tests  # doctest: +ELLIPSIS
      [<DocTest sample_func from ...:12 (1 example)>]
! 
      >>> e = tests[0].examples[0]
      >>> (e.source, e.want, e.lineno)
***************
*** 621,624 ****
--- 621,625 ----
      >>> test = doctest.DocTestFinder().find(f)[0]
      >>> doctest.DocTestRunner(verbose=False).run(test)
+     ... # doctest: +ELLIPSIS
      **********************************************************************
      Failure in example: raise ValueError, 'message'
***************
*** 629,632 ****
--- 630,634 ----
      Got:
          Traceback (most recent call last):
+         ...
          ValueError: message
      (1, 1)
***************
*** 898,902 ****
  Option directives affect only the example that they appear with; they
  do not change the options for surrounding examples:
!     
      >>> def f(x): r'''
      ...     >>> print range(10)       # Should fail: no ellipsis
--- 900,904 ----
  Option directives affect only the example that they appear with; they
  do not change the options for surrounding examples:
! 
      >>> def f(x): r'''
      ...     >>> print range(10)       # Should fail: no ellipsis
***************
*** 985,989 ****
      >>> doctest.DocTestRunner(verbose=False).run(test)
      (0, 1)
!     
  For examples with multi-line source, the option directive may appear
  at the end of any line:
--- 987,991 ----
      >>> doctest.DocTestRunner(verbose=False).run(test)
      (0, 1)
! 
  For examples with multi-line source, the option directive may appear
  at the end of any line:



More information about the Python-checkins mailing list