目前我嘗試創建一個單元測試,它打開一個文件(與相應的應用程序),然後測試運行應該等到程序關閉。Python單元測試:打開並等待,直到程序關閉
def test_HFG(self):
#....
print "please edit this file"
os.chdir(r'C:\test\a')
os.startfile("myfile.vdx")
# here I need a "stop until the program is closed"-function
#....
有沒有人有任何想法如何實現(儘可能簡單)我的計劃?