Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed May 18, 2018
1 parent f600377 commit 1b4ea80
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----
Expand All @@ -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):]

Expand Down

0 comments on commit 1b4ea80

Please sign in to comment.