标签:unit pat end unittest 需要 exe imp pre split
bat如下:
D:
cd D:\workspace\DeductCompare\TestCase
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
标签:unit pat end unittest 需要 exe imp pre split
原文地址:https://www.cnblogs.com/carlvine/p/9797752.html