This pytest plugin allows for the doctesting of C/C++ extension modules for Python created through cython.
You can install pytest-cython via pip from PyPI:
pip install pytest-cythonBasic usage:
pytest --doctest-cythonYou can also run the doctests for a single .pyx file as such:
pytest --doctest-cython path/to/module.pyx- The pytest option
--import-mode=importlibis not supported, though we would like it to be. - When using the pytest option
--import-mode=prependwith packages that are installed in a non-editable fashion, you must set the environment variablePY_IGNORE_IMPORTMISMATCH=1.
The following table describes the versions of Pytest and Cython the each version of the pytest-cython plugin is compatible with.
| Version | Pytest | Cython |
|---|---|---|
| 0.4.x | 9 | 3 |
| 0.3.x | 8 | 0.29, 3 |
| 0.2.x | 6, 7 | 0.29, 3 |
If you encounter any problems, please file an issue along with a detailed description.
This pytest plugin was generated with cookiecutter along with @hackebrot's cookiecutter-pytest-plugin and @ionelmc's cookiecutter-pylibrary templates.