the history of tests being inside Lib/ in Python
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"
On Sat, Jul 30, 2011 at 06:36, Benjamin Peterson
2011/7/29 Eli Bendersky
: 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.
Not really. It seems to be about half/half to me.
I guess I'm mis-informed then :) Out of curiosity, could you point to a few projects that also place tests inside their code? Eli
On Fri, Jul 29, 2011 at 8:44 PM, Eli Bendersky
On Sat, Jul 30, 2011 at 06:36, Benjamin Peterson
wrote: 2011/7/29 Eli Bendersky
: 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.
Not really. It seems to be about half/half to me.
I guess I'm mis-informed then :) Out of curiosity, could you point to a few projects that also place tests inside their code?
You're asking too many questions. Please do some research of your own. Really, this isn't going to change, and asking why it is so or stating that it is rather unusual is just going to irritate the experienced developers. If you want a friendlier answer, please sign up for core-mentorship@python.org, where asking questions about why or why not are welcome. -- --Guido van Rossum (python.org/~guido)
2011/7/29 Eli Bendersky
On Sat, Jul 30, 2011 at 06:36, Benjamin Peterson
wrote: 2011/7/29 Eli Bendersky
: 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.
Not really. It seems to be about half/half to me.
I guess I'm mis-informed then :) Out of curiosity, could you point to a few projects that also place tests inside their code?
Twisted, PyPy, simplejson, Bazaar, buildbot, pyramid, SAGE, Jinja2, Portage, pylint, and Tahoe-LAFS for starters. -- Regards, Benjamin
In article
* 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...
That's not true across the board. For instance, the python.org Mac OS X installers do install the tests "permanently" and, with the addition of the "-m test" (or "-m test.regrtest" in 2.7) command line options, the tests can be easily run at any time on the end user's system. That's one of the reasons why it is important that additions and changes to the tests need to ensure that auxiliary directories and files are installed by the Makefile install targets and not just resident in the build directory. -- Ned Deily, nad@acm.org
On Sat, 30 Jul 2011 06:30:40 +0300, Eli Bendersky
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.
My understanding (I could well be wrong) is that one reason is that we prefer that the tests be installed. That is also the reason that a number of tests that use large data files fetch them from the network (if and only if the relevant resource is enabled). -- R. David Murray http://www.bitdance.com
participants (5)
-
Benjamin Peterson
-
Eli Bendersky
-
Guido van Rossum
-
Ned Deily
-
R. David Murray