Skip to content

cannot report test coverage #1508

@johnyf

Description

@johnyf

I cannot successfully obtain a report of coverage for the Cython module dd.cudd. I have:

I am using nosetests---I do not know whether nose can cause additional difficulties.

Directory layout under /path roughly:

dd/
tests/

Normally, I run nosetests within tests/, because I want to ensure that nosetests will import dd from site-packages (I have also tried the -w option of nosetests).
I have tried running nosetests both inside the tests/ directory, and above it.
nose does not report any results for cudd.pyx.

When nose --with-coverage --cover-package=dd runs under tests/, it creates a .coverage that mentions both a /path/tests/dd/cudd.pyx file (nonexistent), as well as the existing /path/dd/dd/cudd.pyx. For the existing file, coverage report complains that

/path/dd/dd/cudd.pyx   NotPython:
Couldn't parse '/path/dd/dd/cudd.pyx' as Python source: 'invalid syntax' at line 20

Also, manually editing the wrong path reported in .coveragerc produces again the above error.

These observations are with:

  • cython == 0.25.1
  • nose == 1.3.7
  • coverage == 4.2

How can I get coverage to be reported for Cython modules? It seems that this may be a problem both with paths that coverage.py reports, and with failure of coverage.py to parse Cython syntax. I am unsure whether this should be addressed by cython (e.g., in the coverage.py plugin Cython.Coverage), or by coverage.py, or both.

May have some relevance to #1461.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions