我正在使用以下代码来选择我想要一个接一个地运行的测试。
from easygui import *
import sys,os
msg="Select following tests for testing"
title="Test Selector"
choices=["Test_case","Test_case2"]
choice=multchoicebox(msg,title,choices)
print choice
msgbox("You have selected:"+str(choice))
msg="Do you want to continue?"
title="Please confirm"
if ccbox(msg,title):
pass
else:
sys.exit(0)
def func():
for tests in choice:
print "tests",tests
return tests
def main():
execfile('python'+' ' +str( func())+'.py')
main()
现在选择测试后,我想一个接一个地运行这些测试。我正在尝试使用 execfile,但它说
IOError:[Errno 2] 没有这样的文件或目录:'python Test_case.py'
谁能帮帮我吗?