File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111import cadquery as cq
1212
1313from PyQt5 .QtCore import Qt , QSettings
14- from PyQt5 .QtWidgets import QFileDialog , QMessageBox
14+ from PyQt5 .QtWidgets import QApplication , QFileDialog , QMessageBox
1515
1616from cq_editor .__main__ import MainWindow
1717from cq_editor .widgets .editor import Editor
@@ -746,10 +746,15 @@ def test_console(main):
746746 console .execute_command ('a.append(1)' )
747747 assert (len (a ) == 1 )
748748
749+ # execute_command() creates a new prompt to be shown the next time messages are processed
750+ QApplication .processEvents ()
751+
749752 # test print_text
750- pos_orig = console ._prompt_pos
751- console .print_text ('a' )
752- assert (console ._prompt_pos == pos_orig + len ('a' ))
753+ print ('printing text' )
754+ text_before = console ._control .document ().toPlainText ()
755+ console .print_text ('foo' )
756+ text_after = console ._control .document ().toPlainText ()
757+ assert text_after == text_before + 'foo'
753758
754759def test_viewer (main ):
755760
You can’t perform that action at this time.
0 commit comments