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) *  |
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) *  |
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) *  |
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. |
|
|