bat如下:
D:
cd D:workspaceDeductCompareTestCase
python.exe Case.py
原始case.py头如下
import shutil import unittest from datetime import datetime from Logic.ComputionalLogic import ComputionalLogic
报错:找不到Logic模块
需要添加os.path,但是每运行一次需要加一次,暂未找到永久方法
import shutil import unittest import os,sys curPath = os.path.abspath(os.path.dirname(__file__)) rootPath = os.path.split(curPath)[0] sys.path.append(rootPath) from datetime import datetime from Logic.ComputionalLogic import ComputionalLogic