On 7/11/06, Fred Drake <[EMAIL PROTECTED]> 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. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com