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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4