[TIP] including (or not) tests within your package

Ben Finney ben+python at benfinney.id.au
Wed Aug 11 00:55:36 PDT 2010


Barry Warsaw <barry at python.org> writes:

> On Aug 10, 2010, at 12:04 PM, Ben Finney wrote:
>
> >Andrew Bennetts <andrew at bemusement.org> writes:
> >> Surely you don't consider every importable name to be part of the
> >> public interface for a package?
> >
> >Every importable name that isn't marked with a leading-underscore
> >name, yes. That's what that distinction is for, after all.
>
> I think you meant "after __all__".

Bdom-tssh.

> __all__ directly controls what names get imported via from-import-*
> but it's a very strong indicator about what names are intended as part
> of the public interface.

Rather onerous to keep updating that list every time the API changes,
though. The conventions of PEP 8 are much easier to follow, and work by
default.

-- 
 \     “Welchen Teil von ‘Gestalt’ verstehen Sie nicht?  [What part of |
  `\                ‘gestalt’ don't you understand?]” —Karsten M. Self |
_o__)                                                                  |
Ben Finney
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100811/5e9874dd/attachment.pgp>


More information about the testing-in-python mailing list