我想使用一些用Python编写的(单元)测试来获取Cython模块的覆盖率信息。目前我只能得到测试本身的覆盖率,即通过运行
py.test
执行了哪些测试行。虽然看起来很好,但我更想得到.pyx
文件的覆盖率,即我的测试覆盖了哪些C/Python接口的行。我已经找到了一些信息,但无法在我的项目中运行它。
http://blog.behnel.de/posts/coverage-analysis-for-cython-modules.html
https://medium.com/@dfdeshom/better-test-coverage-workflow-for-cython-modules-631615eb197a
以下是相关代码: https://github.com/SCIP-Interfaces/PySCIPOpt/tree/coverage