[Python-checkins] python/dist/src/Lib doctest.py, 1.36.2.21, 1.36.2.22

edloper at users.sourceforge.net edloper at users.sourceforge.net
Fri Aug 6 08:30:24 CEST 2004


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

Modified Files:
      Tag: tim-doctest-branch
	doctest.py 
Log Message:
- Added doctest_factory argument to DocTestFinder


Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.36.2.21
retrieving revision 1.36.2.22
diff -C2 -d -r1.36.2.21 -r1.36.2.22
*** doctest.py	6 Aug 2004 03:38:18 -0000	1.36.2.21
--- doctest.py	6 Aug 2004 06:30:21 -0000	1.36.2.22
***************
*** 793,804 ****
      """
  
!     def __init__(self, verbose=False, namefilter=None, objfilter=None,
!                  recurse=True):
          """
          Create a new doctest finder.
  
          If the optional argument `recurse` is false, then `find` will
          only examine the given object, and not any contained objects.
          """
          self._verbose = verbose
          self._namefilter = namefilter
--- 793,811 ----
      """
  
!     def __init__(self, verbose=False, doctest_factory=DocTest, 
!                  namefilter=None, objfilter=None, recurse=True):
          """
          Create a new doctest finder.
  
+         The optional argument `doctest_factory` specifies a class or
+         function that should be used to create new DocTest objects (or
+         objects that implement the same interface as DocTest).  This
+         signature for this factory function should match the signature
+         of the DocTest constructor.
+ 
          If the optional argument `recurse` is false, then `find` will
          only examine the given object, and not any contained objects.
          """
+         self._doctest_factory = doctest_factory
          self._verbose = verbose
          self._namefilter = namefilter
***************
*** 1009,1013 ****
          else:
              filename = getattr(module, '__file__', module.__name__)
!         return DocTest(docstring, globs, name, filename, lineno)
  
      def _find_lineno(self, obj, source_lines):
--- 1016,1020 ----
          else:
              filename = getattr(module, '__file__', module.__name__)
!         return self._doctest_factory(docstring, globs, name, filename, lineno)
  
      def _find_lineno(self, obj, source_lines):



More information about the Python-checkins mailing list