[Python-Dev] the history of tests being inside Lib/ in Python

Eli Bendersky eliben at gmail.com
Sat Jul 30 05:30:40 CEST 2011


The other thread had some claims (*) that made me wonder - why are the tests
in Python kept in Lib/ at all?

AFAIK, this is rather an unusual project structure. Tests usually have a
top-level directory of their own, in parallel to Lib/, Doc/ and others. Some
effects of this in other projects:

* The tests usually aren't even installed. The user can run them during
installation, but once it goes through, tests are not copied into
/usr/whatever...
* Tests naturally become "developer-domain", removed from the "user-domain".
No sane user would even consider using code from inside the Tests/ directory
and somehow expect it to keep working in later versions. In addition, tests
are then usually documented in special "hacking guides" and "developer docs"
instead of in the official documentation of the project.

This mail can appear as if advocating the transfer of Lib/test into Tests/,
but this is not my intention here. Honest :-) I'm just trying to understand
the history and rationale behind this structure in the CPython project.

Eli

(*) I refer to this reasoning someone raised: "test.support is part of the
tests" + "tests are part of stdlib" --> "test.support must be documented
where the rest of stdlib is"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110730/892efde0/attachment.html>


More information about the Python-Dev mailing list