[Zope-dev] SVN: zope.dottedname/trunk/tox.ini Give up on nose-based coverage, I cannot make it work.

Marius Gedminas marius at gedmin.as
Mon Feb 4 19:04:47 UTC 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://mail.zope.org/pipermail/zope-dev/attachments/20130204/ef279c48/attachment.sig>


More information about the Zope-Dev mailing list