# HG changeset patch # User Edouard Tisserant # Date 1715791826 -7200 # Node ID ebd25bbe5a73cb9f31ca720be5919ea8b99988ed # Parent 5df2cbc1cd1a01a2fa948c6535c8632d59c803bf Tests: fix wx_widgets.pytest/test_CustomIntCtrl.py diff -r 5df2cbc1cd1a -r ebd25bbe5a73 tests/ide_tests/wx_widgets.pytest/test_CustomIntCtrl.py --- a/tests/ide_tests/wx_widgets.pytest/test_CustomIntCtrl.py Wed May 15 08:59:38 2024 +0200 +++ b/tests/ide_tests/wx_widgets.pytest/test_CustomIntCtrl.py Wed May 15 18:50:26 2024 +0200 @@ -33,15 +33,22 @@ import controls.CustomIntCtrl +wxApp = None + class TestCustomIntCtrl(unittest.TestCase): def setUp(self): - self.app = wx.App() + global wxApp + if wxApp is None: + wxApp = wx.App() self.frame = wx.Frame(None) def tearDown(self): + global wxApp self.frame.Destroy() - wx.CallAfter(wx.Exit) - self.app.MainLoop() + if wxApp is not None: + wx.CallAfter(wx.Exit) + wxApp.MainLoop() + wxApp = None def testMaxLimit(self): """Test working upper bound"""