[Python-Dev] Doctest and Footnotes (original) (raw)
Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Jul 11 20:37:37 CEST 2006
- Previous message: [Python-Dev] Doctest and Footnotes
- Next message: [Python-Dev] Doctest and Footnotes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 7/11/06, Fred Drake <fred at zope.com> wrote:
On Tuesday 11 July 2006 14:12, Alexander Belopolsky wrote: > Also new and init method docstrings is the natural place to > put set-up code.
Maybe, if all the tests required the same setup code. That's often not the case.
That's true, but you cannot test an object method without creating the object first. For the main cases you would want the object definition close to the test for the benefit of people who do pydoc Foo.bar, but for corner cases it is better to have a predefined set of exotic objects available under descriptive names. I am also advocating init docstring because in my use-cases it rarely much of documentation because object construction is documented in the class docstring, therefore test set-up code placed in init docstring is unlikely to clobber often-used documentation.
- Previous message: [Python-Dev] Doctest and Footnotes
- Next message: [Python-Dev] Doctest and Footnotes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]