File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed
Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 1616import pytest
1717from pytest import MonkeyPatch
1818import builtins
19+ import wx
1920
2021real_import = builtins .__import__
2122
@@ -232,15 +233,21 @@ def test_replace_std_for_win(self):
232233
233234class TestMisc (unittest .TestCase ):
234235
236+ def setUp (self ):
237+ from robotide .application import RIDE
238+ self .main_app = RIDE ()
239+ self .settings = self .main_app .settings
240+ self .frame = self .main_app .frame
241+ self .main_app .SetExitOnFrameDelete (True )
242+
243+
235244 def tearDown (self ):
236245 builtins .__import__ = real_import
246+ self .main_app .Destroy ()
247+ self .main_app = None
237248
238249 def test_get_code (self ):
239- import wx
240- from robotide .application import RIDE
241-
242- main_app = RIDE ()
243- code = main_app ._get_language_code ()
250+ code = self .main_app ._get_language_code ()
244251 assert code in (175 , wx .LANGUAGE_ENGLISH_WORLD , wx .LANGUAGE_PORTUGUESE )
245252
246253
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414import unittest
15+ import wx
1516
1617class TestMisc (unittest .TestCase ):
1718
18- def test_get_code (self ):
19- import wx
19+ def setUp (self ):
2020 from robotide .application import RIDE
21+ self .main_app = RIDE ()
22+ self .settings = self .main_app .settings
23+ self .frame = self .main_app .frame
24+ self .main_app .SetExitOnFrameDelete (True )
25+
2126
22- main_app = RIDE ()
23- code = main_app ._get_language_code ()
27+ def tearDown (self ):
28+ self .main_app .Destroy ()
29+ self .main_app = None
30+
31+ def test_get_code (self ):
32+ code = self .main_app ._get_language_code ()
2433 assert code in (wx .LANGUAGE_ENGLISH , wx .LANGUAGE_ENGLISH_WORLD , wx .LANGUAGE_PORTUGUESE )
2534 # Uncomment next lines if you want to see the app
2635 # wx.CallLater(8000, main_app.ExitMainLoop)
You can’t perform that action at this time.
0 commit comments