Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaverde committed Jul 31, 2017
1 parent baf4f87 commit 74c5027
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,29 @@ def test_open_files_in_new_editor_window(main_window, qtbot):
assert editorstack.get_stack_count() == 2


@flaky(max_runs=3)
def test_close_when_file_is_changed(main_window, qtbot):
"""Test closing spyder when there is a file with modifications open."""
# Wait until the window is fully up
shell = main_window.ipyconsole.get_current_shellwidget()
qtbot.waitUntil(lambda: shell._prompt_html is not None, timeout=SHELL_TIMEOUT)

# Load test file
test_file = osp.join(LOCATION, 'script.py')
main_window.editor.load(test_file)
editorstack = main_window.editor.get_current_editorstack()
editor = editorstack.get_current_editor()
editor.document().setModified(True)

# Close.main-window
QTimer.singleShot(1000, lambda: close_save_message_box(qtbot))
main_window.close()

# Wait for the segfault
qtbot.wait(3000)



@flaky(max_runs=3)
def test_maximize_minimize_plugins(main_window, qtbot):
"""Test that the maximize button is working correctly."""
Expand Down

0 comments on commit 74c5027

Please sign in to comment.