Skip to content

Cython support #163

Open
Open
@darthlukan

Description

@darthlukan

Feature Request:

I'm working on a Python3.5 project which uses Cython v0.23.4 for several modules via the pyximport method. We're using pytest 3.1.3 and pytest-cov 2.5.1. Currently pytest-cov only reports on .py files. Our tests are written with the convention of test_.py and within those, calls to "def" functions and methods within *.pyx files are made in order to test the output (inside of our *.pyx modules we have a "def" signature for every "cdef" implementation so that non-cython modules in our application can easily call cythonized code in pure python).

Example:

cdef int _return_pos_int():
    return 1

def return_pos_int():
    return _return_pos_int()

If we were testing the example above, our tests would call the function with the "def return_pos_int()" signature.

The current pytest-cov output ignores covered .pyx files, even if there are .py tests accessing those modules. Ideally, pytest-cov would be able to determine the coverage for cython .pyx modules as it does with normal .py modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions