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

Marius Gedminas <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <20130204190447.GA20423@platonas>
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

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
signature.asc (application/pgp-signature, 190 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iD8DBQFREAZPkVdEXeem148RAvqPAJ0YMB7G4P/3z53PKQdrfY2+ZhM6FQCfa9+H
4P+9zweAy1WAJP5FRk7nCsI=
=bHmA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.