On Sun, Apr 13, 2008 at 12:25:46PM -0400, Jim Fulton wrote:
> On Apr 12, 2008, at 10:01 PM, Tres Seaver wrote:
>> Even better:  use the documented setuptools keyword[1]  
>> 'tests_require',
>> and get the testrunner / buildout to use that hook when running tests.
> This doesn't address the central point that testing a different software 
> configuration in testing than will be used in production can lead to 
> unpleasant surprises in production.


@Roger: I think you might have misunderstood the flying-versus-testing
argument. *Any* change in the software configuration that makes the test
environment differ from the production environment raises the risk of getting
unexpected errors. As the world isn't just black and white the two extremes
(no just-for-test dependencies in production versus all-even-just-for-test
dependencies in production) could be spelled out like this:

- Minimize the amount of special dependencies that only your testing code
  needs. (Only get a new dependency for a test if it's really worth it.
  `zope.testing` is an example.)

- Maximize the amount of dependencies that are shared within testing and
  production. (Carrying over `zope.testing` into production is an example as

> As to tests_require, unfortunately, it can't be used by buildout or any 
> other setuptools-based application because it's presence isn't reflected 
> in egg info. :( This is why people who want to provide test dependencies 
> have been forced to use test extras. (tests_require is only usable by the 
> test runner setup command.
> See http://mail.python.org/pipermail/distutils-sig/2007-January/007082.html
> FWIW, I think using test extras is a necessary evil when testing  
> dependencies are significant.  I wouldn't use it just to avoid a  
> dependency on zope.testing, but I would and have used test extras to  
> avoid more extensive dependencies.

+1 as well. One of my intentions here is to avoid getting zope.app.*
dependencies in zope.* packages. However, in the long run, those dependencies
probably should go away by reworking the tests or refactoring the (overall)
code base.


gocept gmbh & co. kg - forsterstrasse 29 - 06112 halle (saale) - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development
Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to