From cafb659bbfab69877b2f30bb30bec47b7e060348 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Tue, 5 Apr 2016 22:41:01 -0400 Subject: [PATCH] Fix process test - was crashing intermittently. Also, check the flag. --- unittests/test_process.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unittests/test_process.py b/unittests/test_process.py index c68b0833..51054c3b 100644 --- a/unittests/test_process.py +++ b/unittests/test_process.py @@ -18,14 +18,16 @@ class process_Tests(wtc.WidgetTestCase): def test_process2(self): - flag = False + self.flag = False def onEndProcess(evt): - flag = True + self.flag = True if 'wxMac' not in wx.PlatformInfo: p = wx.Process(self.frame) self.frame.Bind(wx.EVT_END_PROCESS, onEndProcess) wx.Execute('%s %s' % (sys.executable, testscript), callback=p) + self.waitFor(1000) + self.assertTrue(self.flag) # TODO: When the stream classes are wrapped add tests for writing to and # reading from the process