Hi! On Mon, Feb 04, 2013 at 11:57:31AM -0500, Tres Seaver wrote:
Your issue is actually Pip screwing up namespace packages[1], which then interferes with Nose test discovery.
It looks like your email is missing a footnote. I think I've figured out the namespace package issue, but that doesn't seem to help here -- I'm seeing 0 lines executed in zope.dottedname in coverage report. If I pass --coverage-include to nose, it shows two lines of code (just the outer level, with the def statement) in zope.dottedname.resolve.
From zope.component's tox.ini::
[testenv:coverage] basepython = python2.6 commands = # The installed version messes up nose's test discovery / # coverage reporting # So, we uninstall that from the environment, and then install the # editable version, before running nosetests. pip uninstall -y zope.component python -c "import shutil; shutil.copyfile('src/zope/__init__.py', '{envdir}/lib/python2.6/site-packages/zope/__init__.py')"
Ah! Other zope.* packages on Github have a coverage section in tox.ini with the pip uninstall/pip install -e steps but _without_ the shutil trick. tox -e coverage works for them nonetheless.
pip install -e .
(I did a pip uninstall followed by easy_install zope.testing and python setup.py develop, which also gave me proper namespace package support, but didn't help with coverage numbers.)
nosetests --with-xunit --with-xcoverage deps = zope.component zope.testing zope.hookable ZODB3 zope.location zope.proxy zope.security zope.configuration zope.i18nmessageid nose coverage nosexcover
(It's annoying how one must repeat all the test dependencies here, as well as in setup.py.) Marius Gedminas -- http://pov.lt/ -- Zope 3/BlueBream consulting and development