[Zope-Coders] Re: CVS: Zope/lib/python/ZPublisher/tests - testBaseRequest.py:1.4

Casey Duncan casey at zope.com
Fri Feb 27 14:44:43 EST 2004


We have found that the order the tests run can cause this. The order of
the tests is affected by the order of the files in the directory which
varies across different checkouts. So a fresh checkout can see failures
that another does not due to test interactions between the tests and the
Python process. Big fat side affects == bad

Ironically usually the solution is to add these lines because a test
needs something initialized by the framework, and implicitly relied on
others to go first and do the startup.

-Casey

On Fri, 27 Feb 2004 14:35:51 -0500
Jeremy Hylton <jeremy at zope.com> wrote:

> Update of /cvs-repository/Zope/lib/python/ZPublisher/tests
> In directory cvs.zope.org:/tmp/cvs-serv22939
> 
> Modified Files:
> 	testBaseRequest.py 
> Log Message:
> Calling Zope.startup() seems to cause the tests to die.
> Removing the import and call allows the tests to pass.
> 
> This code is a complete mystery.  It wasn't failing when I ran the
> tests yesterday.  But if I do a checkout -D "yesterday," it fails with
> an error on the Zope.startup() call.  It looks like that code should
> have always failed.  No idea how it ever worked.
> 
> 
> === Zope/lib/python/ZPublisher/tests/testBaseRequest.py 1.3 => 1.4 ===
> --- Zope/lib/python/ZPublisher/tests/testBaseRequest.py:1.3	Tue Nov 18 08:17:18 2003
> +++ Zope/lib/python/ZPublisher/tests/testBaseRequest.py	Fri Feb 27 14:35:50 2004
> @@ -1,8 +1,5 @@
>  from unittest import TestCase, TestSuite, makeSuite, main
>  
> -import Zope
> -Zope.startup()
> -
>  from Acquisition import Implicit
>  from ZPublisher.BaseRequest import BaseRequest
>  from ZPublisher.HTTPResponse import HTTPResponse
> 
> 
> _______________________________________________
> Zope-Checkins maillist  -  Zope-Checkins at zope.org
> http://mail.zope.org/mailman/listinfo/zope-checkins
> 



More information about the Zope-Coders mailing list