Skip to content

Commit 109c110

Browse files
Improve tests using wx
1 parent fa73e4b commit 109c110

File tree

8 files changed

+16
-28
lines changed

8 files changed

+16
-28
lines changed

utest/editor/test_texteditor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def tearDown(self):
174174
# wx.CallAfter(wx.Exit)
175175
self.shared_mem.shm.close()
176176
self.shared_mem.shm.unlink()
177+
self.app.ExitMainLoop()
177178
self.app.Destroy()
178179
self.app = None
179180

@@ -659,6 +660,7 @@ def tearDown(self):
659660
# wx.CallAfter(wx.Exit)
660661
self.shared_mem.shm.close()
661662
self.shared_mem.shm.unlink()
663+
self.app.ExitMainLoop()
662664
self.app.Destroy()
663665
self.app = None
664666

utest/logs/test_log_windows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def my_show(*args):
6161
self._panel.SetSize(200, 400)
6262
self._panel.close(note)
6363

64+
myapp.ExitMainLoop()
65+
myapp.Destroy()
66+
myapp = None
67+
6468
def test_message_log(self):
6569
result = message_to_string(log[0])
6670
assert result.strip() == '20230604 20:40:41.415 [INFO]: Found Robot Framework version 6.0.2 from path'

utest/resources/fake.cfg

Lines changed: 0 additions & 21 deletions
This file was deleted.

utest/run/test_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_command_as_string(self):
3333
assert len(processed_command) == len(initial_command.split())
3434
assert processed_command[4] == 'a2 2 1'
3535

36-
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS'), reason="Fails at Fedora workflow")
36+
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS')=='true', reason="Fails at Fedora workflow")
3737
def test_writing_to_stderr(self):
3838
self.proc = self._create_process('python %s stderr' % SCRIPT)
3939
eol = '\r\n' if IS_WINDOWS else '\n'

utest/run/test_run_anything.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ def update_output(self, output, finished):
5555

5656
class TestRunAnything(UIUnitTestBase):
5757

58-
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS'), reason="Fails at Fedora workflow")
58+
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS')=='true', reason="Fails at Fedora workflow")
5959
def test_run(self):
6060
self.runner = self._create_runner('python %s count_args a b c' % SCRIPT)
6161
self._wait_until_finished()
6262
assert self.runner.finished
6363
assert self.runner.outstr == '3\n'
6464

65-
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS'), reason="Fails at Fedora workflow")
65+
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS')=='true', reason="Fails at Fedora workflow")
6666
def test_stopping(self):
6767
self.runner = self._create_runner('python %s output 0.8' % SCRIPT)
6868
time.sleep(0.3)
@@ -77,7 +77,7 @@ def test_error(self):
7777
assert self.runner.finished
7878
assert self.runner.outstr
7979

80-
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS'), reason="Fails at Fedora workflow")
80+
@pytest.mark.skipif(os.getenv('GITHUB_ACTIONS')=='true', reason="Fails at Fedora workflow")
8181
def test_stderr(self):
8282
self.runner = self._create_runner('python %s stderr' % SCRIPT)
8383
self._wait_until_finished()

utest/run/test_ui_elements.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def setUp(self):
8686
def tearDown(self):
8787
PUBLISHER.unsubscribe_all()
8888
# wx.CallAfter(self.app.ExitMainLoop)
89+
self.app.ExitMainLoop()
8990
self.app.Destroy()
9091
self.app = None
9192

utest/ui/test_contextdialogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def setUp(self):
8787

8888
def tearDown(self):
8989
PUBLISHER.unsubscribe_all()
90-
wx.CallAfter(self.app.ExitMainLoop)
90+
self.app.ExitMainLoop()
9191
self.app.Destroy()
9292
self.app = None
9393
# app.MainLoop() # With this here, there is no Segmentation fault

utest/ui/test_tree.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ def setUp(self):
9191

9292
def tearDown(self):
9393
PUBLISHER.unsubscribe_all()
94-
wx.CallAfter(self.frame.Close)
95-
wx.CallAfter(self.app.ExitMainLoop)
94+
# wx.CallAfter(self.frame.Close)
95+
# wx.CallAfter(self.app.ExitMainLoop)
96+
self.app.ExitMainLoop()
97+
self.app.Destroy()
9698
# self.app.MainLoop() # With this here, there is no Segmentation fault
9799
self.app = None
98100

0 commit comments

Comments
 (0)