diff --git a/qtconsole/tests/test_comms.py b/qtconsole/tests/test_comms.py index 16619f5a..ec76e580 100644 --- a/qtconsole/tests/test_comms.py +++ b/qtconsole/tests/test_comms.py @@ -1,8 +1,9 @@ import time from queue import Empty - import unittest +from flaky import flaky + from qtconsole.manager import QtKernelManager @@ -29,7 +30,6 @@ def setUp(self): self._get_next_msg() self._get_next_msg() - def tearDown(self): """Close the kernel.""" if self.kernel_manager: @@ -51,6 +51,7 @@ def _get_next_msg(self, timeout=10): pass return msg + @flaky(max_runs=10) def test_kernel_to_frontend(self): """Communicate from the kernel to the frontend.""" comm_manager = self.comm_manager @@ -104,6 +105,7 @@ def comm_message(self, msg): msg = self._get_next_msg() assert msg['header']['msg_type'] == 'stream' + @flaky(max_runs=10) def test_frontend_to_kernel(self): """Communicate from the frontend to the kernel.""" comm_manager = self.comm_manager @@ -144,5 +146,6 @@ def test_frontend_to_kernel(self): assert msg['msg_type'] == 'stream' assert msg['content']['text'] == 'close\n' + if __name__ == "__main__": unittest.main()