Issue 1521051: Allow passing DocTestRunner and DocTestCase in doctest (original) (raw)

Created on 2006-07-12 08:47 by freakboy, last changed 2022-04-11 14:56 by admin.

Files
File name Uploaded Description Edit
doctest-configuration.diff freakboy,2006-07-12 08:47 Patch to allow extra customization of DocTestSuite
doctest-configuration-1.diff Kostyantyn.Leschenko,2013-04-07 13:08 review
test.patch jasonamyers,2013-07-28 02:39
Messages (9)
msg50676 - (view) Author: Russell Keith-Magee (freakboy) Date: 2006-07-12 08:47
DocTestRunner can be modified by end users to override default testing behaviour when executing doctests. Similarly, DocTestCase can be extended to override default setup/teardown behaviour. However, when a DocTestSuite is used to discover doctests, it is not possible to specify a user-modified Runner or TestCase. This patch (against svn revision 46884 of Lib/doctest.py) enables end users to specify the class that is used to construct DocTest test cases, and the runner that is used to run DocTest test cases. By default, DocTestSuite will continue to instantiate DocTestRunner and DocTestCase instances as before.
msg50677 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-07 20:08
This looks good to me. Could you add some tests (to Lib/test/test_doctest.py) and update the docs (Doc/lib/libdoctest.tex)? Thanks for your contribution!
msg116170 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-12 11:01
The patch appears to be way out of date. Is there any interest in the concept of this patch, has something similar already been done or what?
msg116222 - (view) Author: Russell Keith-Magee (freakboy3742) * Date: 2010-09-12 17:42
It's still a problem AFAICT. Level of interest is a different matter. Django has needed this since 2006, so we've always shipped a locally modified copy of the doctest module. That said, Django is in the process of moving away from using and recommending doctests, so there's a good chance that we'll be deprecating our local copy in the near future. There's still value in the idea -- it provides configuration points that are consistent and reasonable -- but Django's need for this set of changes is waning.
msg170529 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-09-15 20:00
I think this would be useful as well. For example, it would let one more easily get finer-grained test result data (e.g. to the level of doctest examples rather than just the TestCase level). Without this, I needed to monkey patch. The previously attached patch enhances DocTestSuite. I think DocFileSuite should receive the same treatment (the case I was more interested in myself -- cf. http://bugs.python.org/issue15629#msg170447 ).
msg186204 - (view) Author: Kostyantyn Leschenko (Kostyantyn.Leschenko) Date: 2013-04-07 13:08
I've updated patch to work with current trunk and added new params to doctest documentation.
msg186577 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2013-04-11 18:43
I like the patch but please add tests also. We need to put new behavior in stone :) Take a look on comments to the patch also.
msg193803 - (view) Author: Jason Myers (jasonamyers) Date: 2013-07-28 02:39
The attached file contains a simple test for this code to make sure the test runner is being applied. I've never submitted anything before, so it might be totally naive.
msg411160 - (view) Author: mike mcleod (mikecmcleod) * Date: 2022-01-21 17:35
I would like to help on this issue.
History
Date User Action Args
2022-04-11 14:56:18 admin set github: 43657
2022-01-21 17:35:46 mikecmcleod set nosy: + mikecmcleodmessages: +
2014-02-03 17:04:41 BreamoreBoy set nosy: - BreamoreBoy
2013-07-28 02:39:11 jasonamyers set files: + test.patchnosy: + jasonamyersmessages: +
2013-04-11 18:43:43 asvetlov set messages: +
2013-04-07 13:08:01 Kostyantyn.Leschenko set files: + doctest-configuration-1.diffnosy: + Kostyantyn.Leschenkomessages: +
2013-04-07 10:41:06 asvetlov set nosy: + asvetlov
2012-09-15 20:00:15 chris.jerdonek set nosy: + chris.jerdonektitle: Extra configurability for doctest TestCases -> Allow passing DocTestRunner and DocTestCase in doctestmessages: + versions: + Python 3.4, - Python 3.2
2010-09-12 17:42:16 freakboy3742 set nosy: + freakboy3742messages: +
2010-09-12 11:01:53 BreamoreBoy set nosy: + BreamoreBoymessages: +
2010-08-09 03:35:29 terry.reedy set versions: + Python 3.2, - Python 3.1, Python 2.7
2009-03-30 05:05:54 ajaksu2 set keywords: + easystage: test neededtype: enhancementversions: + Python 3.1, Python 2.7, - Python 2.5
2006-07-12 08:47:04 freakboy create