后台使用项目检测工具

  • projectile

提示 generic 类型项目

问题描述:

运行python-pytest-function-dwim 命令后跳出错误提示:

projectile--test-name-for-impl-name: Cannot determine a test file
name, one of "test-suffix" or "test-prefix" must be set for project
type ‘generic’

原因分析:

  • 这是 projectile 不能识别现有项目类型导致

    • 比如 python 项目,没有 requirements.txt 文件,或 pyproject.toml 文件

解决办法:

  1. 添加项目类型标志文件

    • 例如 requirements.txt
  2. 清除 projectile 的缓存 cache

    • M-x projectile-invalidate-cache