Re: [Zope-dev] SVN: zope.dottedname/trunk/tox.ini Give up on nose-based coverage, I cannot make it work.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/04/2013 11:11 AM, Marius Gedminas wrote: Your issue is actually Pip screwing up namespace packages[1], which then interferes with Nose test discovery. 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')" pip install -e . 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 Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlEP6HsACgkQ+gerLs4ltQ7NogCgrtYwV5zpaU7gH90TsSAWDjuD TyoAoMORhfXWFirjk+gUIv255OO2SrP5 =nUhN -----END PGP SIGNATURE-----
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
participants (2)
-
Marius Gedminas -
Tres Seaver