I would file a bug report but it seems trac.cython.org isn't working? I've very keen to get this working. I don't have any experience hacking on Cython but am willing to learn if someone can point me in the right direction.
Kind regards,
Josh
Joshua Arnott schrieb am 21.06.2016 um 18:22:
> I'm attempting to use Coverage.py to provide coverage analysis for a Python
> package that consists mostly of Cython cdef classes. I've stumbled across
> some issues using the Cython.Coverage module. Not sure if I'm using it
> incorrectly or if there are some bugs.
>
> I've set up an demonstration project here:
>
> https://github.com/snorfalorpagus/hello_cython
>
> If you run "test_hello.py" it should run coverage and produce the HTML
> output.
>
> There are two issues:
>
> 1. Coverage doesn't seem to detect `def/cdef/cpdef` statements within a
> `cdef class` - they are always marked as not run (red)
It might help to set the directive "# cython: binding=True" at the top of
your pyx file.
> 2. The ignore statements in .coveragerc seem to be completely ignored
> for pyx files. This is seen in the example "meow" function in both
> hello.pyx (not ignored) and notcython.py (ignored correctly).
That's quite possible. Back then, I didn't care about ignoring things as
much as making things work at all. ;-)
> I would file a bug report but it seems trac.cython.org isn't working? I've
> very keen to get this working. I don't have any experience hacking on
> Cython but am willing to learn if someone can point me in the right
> direction.
The whole coverage integration plugin is in Cython/Coverage.py. Try
debugging the coverage package to see where things go wrong with the
ignored lines. My guess is that this happens somewhere in the reporting
step, i.e. after the runtime data collection.
Stefan