[TIP] tox vs buildout
Chris Withers
chris at simplistix.co.uk
Fri Dec 16 00:09:36 PST 2011
On 14/12/2011 11:05, holger krekel wrote:
> There is an undocumented option of specifying sdistsrc=PATH
> in the [tox] section. That might help.
This is great :-)
I'd suggest documenting this and making it official!
So, I'm a lot further on now, I have three outstanding concerns:
- testing dependencies
It seems that my current practice of doing the equivalent of running
"python setup.py testfixtures[test]" to install the testing dependencies
isn't enough.
What would work with tox? Can I pip install from a requirements file to
get my test dependencies to be installed? If so, what should I put in my
tox.ini to make sure I install into the right tox virtualenv?
- what code is being run and tested?
From my current best run:
[TOX] /Users/chris/LocalGIT/testfixtures/.tox/py26/log$ ../bin/pip
install
--download-cache=/Users/chris/LocalGIT/testfixtures/.tox/_download -U
--no-deps ../../../dist/testfixtures-2.3.3.tar.gz >3.log
[TOX] /Users/chris/LocalGIT/testfixtures$ .tox/py26/bin/nosetests
Now, as read, nose will scan for tests in (and might well import
software from!) my checkout, rather than the sdist that's just been
installed. What's the tox-recommended way of avoiding this?
Put "cd .tox" as one of my commands?
Can I specify that the working directory should be the current
virtualenv that tox is using?
- EPD Python2.7 versus virtualenv
So, my Python 2.7 comes from EPD on Mac OS X, and Tox complains about
this as follows:
[TOX] /Users/chris/LocalGIT/testfixtures/.tox$
/Library/Frameworks/EPD64.framework/Versions/7.1/bin/python2.7
/Users/chris/buildout-eggs/virtualenv-1.7-py2.6.egg/virtualenv.py
--distribute --no-site-packages py27 >py27/log/0.log
[TOX] ERROR: invocation failed, logfile:
/Users/chris/LocalGIT/testfixtures/.tox/py27/log/0.log
[TOX] ERROR: /Users/chris/LocalGIT/testfixtures/.tox$
/Library/Frameworks/EPD64.framework/Versions/7.1/bin/python2.7
/Users/chris/buildout-eggs/virtualenv-1.7-py2.6.egg/virtualenv.py
--distribute --no-site-packages py27 >py27/log/0.log
The --no-site-packages flag is deprecated; it is now the default behavior.
New python executable in py27/bin/python2.7
Also creating executable in py27/bin/python
ERROR: The executable py27/bin/python2.7 is not functioning
ERROR: It thinks sys.prefix is
u'/Library/Frameworks/EPD64.framework/Versions/7.1' (should be
u'/Users/chris/LocalGIT/testfixtures/.tox/py27')
ERROR: virtualenv is not compatible with this system or executable
[TOX] ERROR: InvocationError:
/Library/Frameworks/EPD64.framework/Versions/7.1/bin/python2.7
/Users/chris/buildout-eggs/virtualenv-1.7-py2.6.egg/virtualenv.py
--distribute --no-site-packages py27 (see
/Users/chris/LocalGIT/testfixtures/.tox/py27/log/0.log)
What's wrong here?
Also, why is Tox using
Users/chris/buildout-eggs/virtualenv-1.7-py2.6.egg/virtualenv.py ?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
More information about the testing-in-python
mailing list