buildout, zc.recipe.testrunner and tests_require

I'm using zc,buildout to manage the development of a very simple web application. I'd like to have a simple test runner that runs my doctests, but have run into a slight problem. I'm using wsgi_intercept to aid in testing, but unfortunately wsgi_intercept isn't a proper Python package ("yet", according to Titus). So I have a package-i-fied version in my svn repository and in my buildout.cfg I specify: develop = . ./wsgi_intercept_ I initially was using the "interpreter" option to get a Python interpreter with my eggs on the path, and running "./bin/python setup.py test". That, however, required me to list wsgi_intercept as a package requirement, when I really want to list it as a testing requirement. Moving it to a testing requirement caused it's develop egg not to be on the PYTHONPATH, so setuptools tries to find it. Which it couldn't. I tried using zc.recipe.testbrowser, thinking that maybe it'd look at the tests_require for the target eggs, but no such luck. The testrunner also seems pretty promiscuous in looking for things to test (it tries to import my eggs directory and test them which predictably doesn't work), but that's another story. So... any suggestions on using zc.buildout along with testing dependencies (generally or with zc.recipe.testrunner)? Thanks, Nathan

On Mar 11, 2007, at 11:08 AM, Nathan R. Yergler wrote: ...
I tried using zc.recipe.testbrowser, thinking that maybe it'd look at the tests_require for the target eggs, but no such luck.
The tests_require option is only visible to the setup script. It doesn't cause any data to be included in egg info. It is an attractive nuisance IMO. See: http://mail.python.org/pipermail/distutils-sig/2007-January/ 007082.html In situations like this, I use a test extra and extra_requires to specify testing dependencies. Then, when using the testrunner recipe, I use something like: eggs = foo [test] to indicate that the test runner should load and test the foo egg with its test dependencies.
The testrunner also seems pretty promiscuous in looking for things to test (it tries to import my eggs directory and test them which predictably doesn't work), but that's another story.
That's odd. I haven't seen this problem. What settings were you providing? The testrunner recipe uses the Zope test runner, http:// www.python.org/pypi/zope.testing, which I think has a lot of nice features to support development, but It doesn't yet support running tests from zipped eggs. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jim Fulton wrote:
On Mar 11, 2007, at 11:08 AM, Nathan R. Yergler wrote: ...
I tried using zc.recipe.testbrowser, thinking that maybe it'd look at the tests_require for the target eggs, but no such luck.
The tests_require option is only visible to the setup script. It doesn't cause any data to be included in egg info. It is an attractive nuisance IMO.
I hope the attached patch (against the head of the setuptools 0.6 branch) makes it less of a nuisance. The patch adds an egg-info file entry point which writes the 'tests_require' value to a fill in the .egg-info directory. It would be trivial to add another which dumped the 'test_suite' info as well: perhaps a single ConfigParser-style file with two keys would have more parsimony. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHPHVJ+gerLs4ltQ4RAlGHAJ4o4tJrYInQkWB0Xv6KB3oNhAscHQCg0Kjl 9XLihjJaaU6coaBo/dpwkvE= =zSQH -----END PGP SIGNATURE-----

At 11:35 AM 11/15/2007 -0500, Tres Seaver wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jim Fulton wrote:
On Mar 11, 2007, at 11:08 AM, Nathan R. Yergler wrote: ...
I tried using zc.recipe.testbrowser, thinking that maybe it'd look at the tests_require for the target eggs, but no such luck.
The tests_require option is only visible to the setup script. It doesn't cause any data to be included in egg info. It is an attractive nuisance IMO.
I hope the attached patch (against the head of the setuptools 0.6 branch) makes it less of a nuisance. The patch adds an egg-info file entry point which writes the 'tests_require' value to a fill in the .egg-info directory.
Interesting, and worth considering. Meanwhile, note that you can also distribute this as a plugin, or register the entry point in zc.buildout. That is, you don't need this to be a patch in order to get the same behavior in a given Python installation.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Phillip J. Eby wrote:
At 11:35 AM 11/15/2007 -0500, Tres Seaver wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jim Fulton wrote:
On Mar 11, 2007, at 11:08 AM, Nathan R. Yergler wrote: ...
I tried using zc.recipe.testbrowser, thinking that maybe it'd look at the tests_require for the target eggs, but no such luck. The tests_require option is only visible to the setup script. It doesn't cause any data to be included in egg info. It is an attractive nuisance IMO. I hope the attached patch (against the head of the setuptools 0.6 branch) makes it less of a nuisance. The patch adds an egg-info file entry point which writes the 'tests_require' value to a fill in the .egg-info directory.
Interesting, and worth considering. Meanwhile, note that you can also distribute this as a plugin, or register the entry point in zc.buildout. That is, you don't need this to be a patch in order to get the same behavior in a given Python installation.
Thanks, I realized that I could distribute it separately about 3 seconds after hitting "Send". :) I just uploaded 'eggtestinfo-.0.1.tar.gz' to the cheeseshop. It exports both the 'test_suite' and the 'tests_require' information to a single 'test_info.txt' file. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHPH2E+gerLs4ltQ4RAmUYAJ9xv6ounUdYV8FY1IIA3aNuGXCulQCfZTrh Y4FIeBAYP+dEGkwAMLuRw6s= =83wG -----END PGP SIGNATURE-----
participants (4)
-
Jim Fulton
-
Nathan R. Yergler
-
Phillip J. Eby
-
Tres Seaver