@@ -125,12 +125,13 @@ def setUp(self):
125125 self .source = self .app .tree .controller
126126 self .app .frame .SetStatusText ("File:" + self .app .project .data .source )
127127 # Uncomment next line (and MainLoop in tests) if you want to see the app
128- # self.frame.Show()
128+ self .frame .Show ()
129129
130130 def tearDown (self ):
131131 self .plugin .unsubscribe_all ()
132132 PUBLISHER .unsubscribe_all ()
133- self .app .project .close ()
133+ if self .app .project :
134+ self .app .project .close ()
134135 # wx.CallAfter(self.app.ExitMainLoop)
135136 # self.app.MainLoop() # With this here, there is no Segmentation fault
136137 # wx.CallAfter(wx.Exit)
@@ -204,6 +205,7 @@ def test_last_update_done_less_than_a_week_ago(self):
204205 self .assertFalse (self ._callback_called )
205206
206207 def test_check_for_updates_is_false (self ):
208+ self .app = MyApp ()
207209 with mock .patch .dict (os .environ , {'RIDESETTINGS' : self .app .settings .fake_cfg }):
208210 settings = self .internal_settings (check_for_updates = False )
209211 original_time = settings [LASTUPDATECHECK ]
@@ -212,6 +214,9 @@ def test_check_for_updates_is_false(self):
212214 self .assertFalse (settings [CHECKFORUPDATES ])
213215 self .assertEqual (original_time , settings [LASTUPDATECHECK ])
214216 self .assertFalse (self ._callback_called )
217+ # Uncomment next lines if you want to see the app
218+ wx .CallLater (5000 , self .app .ExitMainLoop )
219+ self .app .MainLoop ()
215220
216221 def test_no_update_found (self ):
217222 with mock .patch .dict (os .environ , {'RIDESETTINGS' : self .app .settings .fake_cfg }):
0 commit comments