From dc08cbdbe2677df38e8f3a0ba59b41daaf2472a1 Mon Sep 17 00:00:00 2001 From: "Lumberbot (aka Jack)" <39504233+meeseeksmachine@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:12:37 -0700 Subject: [PATCH] Backport PR #22618 on branch 6.x (PR: Fix `test_copy_paste_autoindent` forcing text over the clipboard to work (Editor)) (#22619) Co-authored-by: Carlos Cordoba --- .../editor/widgets/codeeditor/tests/test_autoindent.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spyder/plugins/editor/widgets/codeeditor/tests/test_autoindent.py b/spyder/plugins/editor/widgets/codeeditor/tests/test_autoindent.py index ea2f07e0465..c98f8d0edf7 100644 --- a/spyder/plugins/editor/widgets/codeeditor/tests/test_autoindent.py +++ b/spyder/plugins/editor/widgets/codeeditor/tests/test_autoindent.py @@ -469,10 +469,8 @@ def test_copy_paste_autoindent(codeeditor): # Copy cursor = editor.textCursor() cursor.setPosition(30) - cursor.setPosition(59, QTextCursor.KeepAnchor) + cursor.setPosition(51, QTextCursor.KeepAnchor) editor.setTextCursor(cursor) - cb = QApplication.clipboard() - cb.setText("d\n if e:\n f", mode=cb.Clipboard) editor.copy() d = { @@ -495,10 +493,8 @@ def test_copy_paste_autoindent(codeeditor): # Copy cursor = editor.textCursor() cursor.setPosition(30-4) - cursor.setPosition(59, QTextCursor.KeepAnchor) + cursor.setPosition(51, QTextCursor.KeepAnchor) editor.setTextCursor(cursor) - cb = QApplication.clipboard() - cb.setText(" d\n if e:\n f", mode=cb.Clipboard) editor.copy() d = {