0
我在我的wxPython GUI上運行unittests。測試的工作與預期大致相同,只是我創建的框架不會消失。到我的測試結束時,我有30個或更多的頂級窗口。這是我的安裝和拆卸代碼:如何在unittest中銷燬wxPython框架
def setUp(self):
self.app = wx.App()
self.frame = MyGridFrame()
def tearDown(self):
self.frame.Destroy()
for wind in wx.GetTopLevelWindows():
wind.Destroy()
self.app.Destroy()
我嘗試了四行你在我拆解功能看到幾種不同的組合,但它們都具有相同的(缺少任何)的影響。