[Distutils] [buildout] testing framework - avoiding os.popen calls

Jim Fulton jim at zope.com
Wed Jun 4 16:43:20 CEST 2008


On Jun 4, 2008, at 7:43 AM, Tarek Ziadé wrote:

> Hello
>
> Right now when people write tests with zc.buildout, to try out their  
> buildout they roughly do:
>
> >>> from zc.buildout.testing import system
> >>> system('bin/buildout -c my-config.cfg')
> ...
> usual output
> ...
>
> The problem is, the system() function uses os.popen to call the  
> buildout script, making it hard to debug.
> For instance, you are not able to put a pdb and trace as you would  
> do in the same program, which is painful
>
> What about adding in zc.buildout.testing a new function called  
> "buildout" that could be used to run
> a buildout in the tests/doctests the same way :
>
> >>> from zc.buildout.testing import buildout
> >>> buildout('my-config.cfg')
> ...
> usual output
> ...
>
> I could do a branch for that but if everyone agrees, I guess I can  
> push that extra function into the trunk


I think it would be very hard to get this right.  A better solution  
might be to add a Python API to buildout and use that.  Buildout isn't  
currently designed to be used that way, but a Python API would be a  
nice enhancement.

Jim

--
Jim Fulton
Zope Corporation




More information about the Distutils-SIG mailing list