目标是为使用Cython的Python3项目使用pytest单元测试框架。这不是即插即用的事情,因为pytest在默认情况下无法导入Cython模块。也就是说,当从Cython模块导入时,我得到了以下错误,在我的例子中,这个错误名为“calculateScore”: fromcalculateScore import some_functions
E
from context import ThisClassWillBeExported
当我只有一个test目录和一个context.py时,一切正常,但是当我添加更多的测试(如上面的目录树所描述的)时,pytest执行将返回以下错误。ImportError while importing test module 'path/to/module_root/tests/test_this_module_will_be_exported.pytest_this_module_will_be_ex