[Zope-dev] [Checkins] SVN: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path

Michael Howitz mh at gocept.com
Fri Nov 26 02:37:47 EST 2010


Hi,

currently the ZTK tests on the trunk do not run successfully in a virtualenv. 

The errors look like:

atom:trunk mac$ bin/test-ztk
Running test-ztk-zope.securitypolicy
test-ztk-zope.securitypolicy failed with:
Traceback (most recent call last):
  File "/Users/mac/Documents/tmp/zopetoolkit/trunk/bin/test-ztk-zope.securitypolicy", line 35, in <module>
    import zope.testrunner
  File "/Users/mac/Documents/eggs/zope.securitypolicy-3.7.0-py2.5.egg/zope/__init__.py", line 1, in <module>
    __import__('pkg_resources').declare_namespace(__name__)
  File "/Users/mac/Documents/eggs/distribute-0.6.14-py2.5.egg/pkg_resources.py", line 17, in <module>
    from urlparse import urlparse, urlunparse
ImportError: No module named urlparse
...

When I revert the following change, only the test for zope.testing fails (and all zope.app-tests pass):

Am 06.10.2010 um 08:40 schrieb Jan-Jaap Driessen:
> Log message for revision 117268:
>  Don't import site on initialization, as this mitigates the buildout 1.5 way of setting sys.path
> 
> Changed:
>  U   z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py
> 
> -=-
> Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py
> ===================================================================
> --- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py	2010-10-06 06:30:44 UTC (rev 117267)
> +++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/runner.py	2010-10-06 06:40:43 UTC (rev 117268)
> @@ -31,7 +31,7 @@
>     def start(self):
>         self.start = time.time()
>         self.process = subprocess.Popen(
> -            [sys.executable, self.script, '--exit-with-status'] + self.args,
> +            [sys.executable, '-S', self.script, '--exit-with-status'] + self.args,
>             stdin=subprocess.PIPE,
>             stdout=subprocess.PIPE,
>             stderr=subprocess.STDOUT,

But reverting this change does not help to get the tests of z3c.recipe.compattest itself running again. There are the same errors like before.

Is it intensional that ZTK tests fail in virtualenv?
What needs be done to get the tests running again in virtualenv?



Yours sincerely,
-- 
Michael Howitz · mh at gocept.com · software developer
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development



More information about the Zope-Dev mailing list