diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index 336f861397e..e39a2d7e21a 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -1575,6 +1575,8 @@ def test_render_issue(): assert test_description in test_issue_2 assert test_traceback in test_issue_2 +@flaky(max_runs=3) +@pytest.mark.slow def test_history(main_window, qtbot): """Test History""" # ---- Setup ---- @@ -1591,13 +1593,15 @@ def test_history(main_window, qtbot): commands = [] for i, client in enumerate(clients): shell = client.shellwidget - commands.append('i = {i}'.format(i=i)) + commands.append('i = {i}\n'.format(i=i)) shell.execute(commands[-1]) qtbot.waitUntil(lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT) + print(main_window.historylog.editors[0].toPlainText()[-10:]) - commands_text = '\n'.join(commands) + commands_text = ''.join(commands) index = main_window.historylog.filenames.index("iPython history") + assert index == 0 text = main_window.historylog.editors[index].toPlainText()[-len(commands_text):] history = main_window.historylog.histories[index][-len(clients):]