From 0bf80280cab54eb7b4afd13508eead8847a68f18 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Thu, 27 Jul 2017 22:51:42 -0500 Subject: [PATCH] Deletes print test. --- spyder/app/tests/test_mainwindow.py | 37 ----------------------------- 1 file changed, 37 deletions(-) diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index 36471ac520d..38571f44cd5 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -20,7 +20,6 @@ import pytest from qtpy import PYQT5, PYQT_VERSION from qtpy.QtCore import Qt, QTimer -from qtpy.QtPrintSupport import QAbstractPrintDialog, QPrintDialog from qtpy.QtTest import QTest from qtpy.QtWidgets import QApplication, QFileDialog, QLineEdit @@ -73,15 +72,6 @@ def open_file_in_editor(main_window, fname, directory=None): QTest.keyClick(w, Qt.Key_Enter) -def print_file(main_window, result, selection_option=False): - """Check if the print dialog has the correct option""" - top_level_widgets = QApplication.topLevelWidgets() - for w in top_level_widgets: - if isinstance(w, QPrintDialog): - result.append(selection_option == w.testOption(QAbstractPrintDialog.PrintSelection)) - QTest.keyClick(w, Qt.Key_Escape) - - def reset_run_code(qtbot, shell, code_editor, nsb): """Reset state after a run code test""" with qtbot.waitSignal(shell.executed): @@ -175,33 +165,6 @@ def test_calltip(main_window, qtbot): main_window.editor.close_file() -@flaky(max_runs=3) -@pytest.mark.skipif(os.name == 'nt', - reason="QtWarningMsg: QPrintDialog: Cannot be used on non-native printer") -def test_print_file(main_window, qtbot, tmpdir): - """Test print funtionality.""" - # ---- Load test file ---- - test_file = osp.join(LOCATION, 'script.py') - editor = main_window.editor - editor.load(test_file) - code_editor = editor.get_focus_widget() - - # --- Test without selecting text --- - # Set a timer to manipulate the print dialog while it's running - result = [] - QTimer.singleShot(2000, lambda: print_file(main_window, result)) - editor.print_file() - assert True in result - - # --- Test selecting text -- - # Select all the text and set a timer to manipulate the print dialog while it's running - result = [] - code_editor.selectAll() - QTimer.singleShot(2000, lambda: print_file(main_window, result, selection_option=True)) - editor.print_file() - assert True in result - - @flaky(max_runs=3) def test_runconfig_workdir(main_window, qtbot, tmpdir): """Test runconfig workdir options."""