[Distutils] [zc.buildout] building a testrunner
marius at pov.lt
Thu Jul 24 22:29:19 CEST 2008
On Thu, Jul 24, 2008 at 07:58:30PM +0100, Chris Withers wrote:
> Jim Fulton wrote:
> >Don't know. Must be a windows thing. ;)
> >I tried your buildout -- even on windows :) -- at it worked fine for me.
> >The test ran find (with a test failure). I suggest making sure your
> >Python is clean.
> Well, I just tried this on linux on both python2.4 and python2.5, source
> built pythons and got very similar results to those on windows.
> (with the testrunner tripping up on stuff in the egg cache)
What does your buildout.cfg look like?
> PS: The buildout.cfg I'm now using is also checked in and the svn path
> is https://secure.simplistix.co.uk/svn/Simplistix/twiddler/trunk
Ah, I see you anticipated my question.
> I've also attached the bin/test script. It'd be interesting to know if
> this differs from yours.
And here it is:
> import sys
> sys.path[0:0] = [
> import os
> sys.argv = os.path.abspath(sys.argv)
> import zope.testing.testrunner
> if __name__ == '__main__':
> '--test-path', '/home/chris/twiddler',
This is Not Good. You don't want the test runner to look for tests
under /home/chris/twiddler/, which contains the egg cache directly under
it, as well as your Python packages.
People who use an intermediate 'src/' subdir do not get the problem you
stumbled upon. I think an intermediate directory is a Very Good Idea,
* you want to be able to import 'twiddler', which means
/home/chris/twiddler/ must be in you sys.path
* you don't want setup.py or bootstrap.py to be in your sys.path, which
contradicts the above requirement
OTOH if you want to keep your current package layout, you need to
convince zc.recipe.testrunner to use a different --test-path
(specifically, '/home/chris/twiddler/twiddler'). I've no idea how to
achieve this. I'd choose the other solution (insert a src/ subdir into
my tree, above the twiddler subdir).
> The only other thing I can think of: do you maybe have "default user
> config files" living in ~ that are influencing zope.testing or
> zc.recipe.testrunner in some way?
You can override the egg cache location in a dotfile in your home.
Power users do that to avoid downloading the same eggs over and over
again for each project they're working on.
Most security experts REALLY believe in firewalls. The expect that, when they
die, arrive at the great firewall in the sky where Saint Peter is running a
default policy of REJECT.
--- Sander Plomp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the Distutils-SIG