This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年09月10日 23:54 by chris.jerdonek, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue15916.patch | tuukka, 2012年10月23日 12:04 | review | ||
| issue15916-no-exception.patch | Glenn.Jones, 2014年04月14日 18:07 | review | ||
| issue15916-with-docs.patch | Glenn.Jones, 2014年04月14日 21:00 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg170250 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年09月10日 23:54 | |
Currently, calling doctest.DocTestSuite() raises a ValueError if the module passed to it has no docstrings. This was the subject of issue 14649. This issue is to discuss and possibly change DocTestSuite's behavior not to raise an exception in that situation. In the discussion for issue 14649 (in particular with R. David Murray), it was acknowledged that the current behavior probably isn't correct or desirable. However, treating the behavior as a bug and fixing it in maintenance branches would have been too big of a change. Thus, if this change is made, it could be slated for the next feature release. |
|||
| msg173597 - (view) | Author: Tuukka Hastrup (tuukka) | Date: 2012年10月23日 12:04 | |
I'm attaching a patch that changes DocTestSuite's default behaviour as suggested. |
|||
| msg173632 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年10月23日 18:53 | |
Hmm. This patch still raises the "has no docstrings" ValueError if "not tests" is True. And because the patch changes the default DocTestFinder, it's possible that the patch changes behavior in non-error use cases. Why not just return an empty TestSuite if not tests is True? IIRC, this was the conclusion of the issue 14649 discussion. |
|||
| msg216145 - (view) | Author: Glenn Jones (Glenn.Jones) * | Date: 2014年04月14日 18:07 | |
I've attached a patch that uses the original default DocTestFinder and does not raise an exception when there are no tests. |
|||
| msg216169 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2014年04月14日 18:49 | |
This looks good, however we also need a documentation change indicating the new behavior, including a '.. versionchanged:: 3.5' tag, and an entry in whatsnew/3.5 in the 'other changes' section. |
|||
| msg216211 - (view) | Author: Glenn Jones (Glenn.Jones) * | Date: 2014年04月14日 21:00 | |
Added docs to patch |
|||
| msg216255 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年04月15日 00:29 | |
New changeset 57fb5441a4aa by R David Murray in branch 'default': #15916: if there are no docstrings, make empty suite, not an error. http://hg.python.org/cpython/rev/57fb5441a4aa |
|||
| msg216256 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2014年04月15日 00:29 | |
Thanks, Glenn. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:35 | admin | set | github: 60120 |
| 2014年04月15日 00:29:46 | r.david.murray | set | status: open -> closed resolution: fixed messages: + msg216256 stage: resolved |
| 2014年04月15日 00:29:04 | python-dev | set | nosy:
+ python-dev messages: + msg216255 |
| 2014年04月14日 21:00:05 | Glenn.Jones | set | files:
+ issue15916-with-docs.patch messages: + msg216211 |
| 2014年04月14日 18:49:51 | r.david.murray | set | messages: + msg216169 |
| 2014年04月14日 18:07:20 | Glenn.Jones | set | files:
+ issue15916-no-exception.patch nosy: + Glenn.Jones messages: + msg216145 |
| 2014年04月14日 16:20:36 | r.david.murray | set | messages: - msg174146 |
| 2014年04月14日 16:20:27 | r.david.murray | set | messages: - msg174145 |
| 2012年10月29日 19:39:20 | petri.lehtinen | set | messages: + msg174146 |
| 2012年10月29日 19:38:44 | petri.lehtinen | set | nosy:
+ petri.lehtinen messages: + msg174145 |
| 2012年10月24日 20:45:36 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2012年10月23日 18:53:57 | chris.jerdonek | set | messages: + msg173632 |
| 2012年10月23日 12:04:01 | tuukka | set | files:
+ issue15916.patch nosy: + tuukka messages: + msg173597 keywords: + patch |
| 2012年09月10日 23:54:54 | chris.jerdonek | create | |