Skip to content

Commit

Permalink
Mark CI-unskipped tests slow and revert excess whitespace removals
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Jan 24, 2018
1 parent c76e8e0 commit ecc3488
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def close_window():
#==============================================================================
# IMPORTANT NOTE: Please leave this test to be the first one here to
# avoid possible timeouts in Appveyor
@pytest.mark.slow
@pytest.mark.use_introspection
@flaky(max_runs=3)
@pytest.mark.skipif(os.name == 'nt',
Expand Down
1 change: 1 addition & 0 deletions spyder/plugins/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def test_read_stderr(ipyconsole, qtbot):
assert content == client._read_stderr()


@pytest.mark.slow
@flaky(max_runs=10)
@pytest.mark.no_xvfb
@pytest.mark.skipif(os.environ.get('CI', None) is not None and os.name == 'nt',
Expand Down
36 changes: 18 additions & 18 deletions spyder/widgets/tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def test_find_number_matches(qtbot):

def test_move_current_line_up(editor_bot):
editor_stack, editor, qtbot = editor_bot

# Move second line up when nothing is selected.
editor.go_to_line(2)
editor.move_line_up()
Expand All @@ -130,26 +130,26 @@ def test_move_current_line_up(editor_bot):
'\n'
'x = 2\n')
assert editor.toPlainText() == expected_new_text

# Move line up when already at the top.
editor.move_line_up()
assert editor.toPlainText() == expected_new_text

# Move fourth line up when part of the line is selected.
editor.go_to_line(4)
editor.go_to_line(4)
editor.moveCursor(QTextCursor.Right, QTextCursor.MoveAnchor)
for i in range(2):
editor.moveCursor(QTextCursor.Right, QTextCursor.KeepAnchor)
editor.move_line_up()
expected_new_text = ('print(a)\n'
'a = 1\n'
'a = 1\n'
'x = 2\n'
'\n')
assert editor.toPlainText()[:] == expected_new_text

def test_move_current_line_down(editor_bot):
editor_stack, editor, qtbot = editor_bot

# Move fourth line down when nothing is selected.
editor.go_to_line(4)
editor.move_line_down()
Expand All @@ -159,11 +159,11 @@ def test_move_current_line_down(editor_bot):
'\n'
'x = 2')
assert editor.toPlainText() == expected_new_text

# Move line down when already at the bottom.
editor.move_line_down()
assert editor.toPlainText() == expected_new_text

# Move first line down when part of the line is selected.
editor.go_to_line(1)
editor.moveCursor(QTextCursor.Right, QTextCursor.MoveAnchor)
Expand All @@ -176,50 +176,50 @@ def test_move_current_line_down(editor_bot):
'\n'
'x = 2')
assert editor.toPlainText() == expected_new_text

def test_move_multiple_lines_up(editor_bot):
editor_stack, editor, qtbot = editor_bot

# Move second and third lines up.
editor.go_to_line(2)
cursor = editor.textCursor()
cursor.movePosition(QTextCursor.Down, QTextCursor.KeepAnchor)
cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor)
editor.setTextCursor(cursor)
editor.move_line_up()

expected_new_text = ('print(a)\n'
'\n'
'a = 1\n'
'x = 2\n')
assert editor.toPlainText() == expected_new_text

assert editor.toPlainText() == expected_new_text
# Move first and second lines up (to test already at top condition).
editor.move_line_up()
assert editor.toPlainText() == expected_new_text

def test_move_multiple_lines_down(editor_bot):
editor_stack, editor, qtbot = editor_bot

# Move third and fourth lines down.
editor.go_to_line(3)
cursor = editor.textCursor()
cursor.movePosition(QTextCursor.Down, QTextCursor.KeepAnchor)
cursor.movePosition(QTextCursor.Right, QTextCursor.KeepAnchor)
editor.setTextCursor(cursor)
editor.move_line_down()

expected_new_text = ('a = 1\n'
'print(a)\n'
'\n'
'\n'
'x = 2')
assert editor.toPlainText() == expected_new_text

# Move fourht and fifth lines down (to test already at bottom condition).
editor.move_line_down()
assert editor.toPlainText() == expected_new_text

def test_run_top_line(editor_bot):
editor_stack, editor, qtbot = editor_bot
editor.go_to_line(1) # line number is one based
Expand Down

0 comments on commit ecc3488

Please sign in to comment.