add tests (在测试模块,增加 emv界面测试 和 计量界面测试)
This commit is contained in:
17
tests/common.py
Normal file
17
tests/common.py
Normal file
@ -0,0 +1,17 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 注意: 只在 tests 目录下的 测试文件中使用
|
||||
# 设置项目目录 为搜索目录
|
||||
|
||||
|
||||
# 通用逻辑:添加项目根目录到搜索路径
|
||||
def add_project_root_to_path():
|
||||
# 获取项目根目录(tests的上级目录)
|
||||
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if project_root not in sys.path:
|
||||
sys.path.append(project_root)
|
||||
|
||||
|
||||
# 自动执行(导入时就添加路径)
|
||||
add_project_root_to_path()
|
||||
Reference in New Issue
Block a user