unittest类无法在python中导入源模块

2024-04-19 07:17:27 发布

您现在位置:Python中文网/ 问答频道 /正文

以下是我的目录结构:

projectFolder
  src
    __init__.py
    controller
      __init.py
      moduleA.py
  test
    __init__.py
    test_moduleA.py

下面是我在test_模块py中的导入语句

import src.controller.moduleA as moda

Tags: 模块pytestimportsrc目录initas