Switch test code to PyQt6

This commit is contained in:
Veronica Berglyd Olsen
2025-01-11 20:36:42 +01:00
parent 40c4e74d48
commit da036efdcf
47 changed files with 169 additions and 160 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ from pathlib import Path
import pytest
from PyQt5.QtWidgets import QAction, QMessageBox
from PyQt6.QtGui import QAction
from PyQt6.QtWidgets import QMessageBox
from novelwriter import SHARED
from novelwriter.dialogs.about import GuiAbout
+2 -2
View File
@@ -22,8 +22,8 @@ from __future__ import annotations
import pytest
from PyQt5.QtCore import QItemSelectionModel
from PyQt5.QtWidgets import QListWidgetItem
from PyQt6.QtCore import QItemSelectionModel
from PyQt6.QtWidgets import QListWidgetItem
from novelwriter.dialogs.editlabel import GuiEditLabel
from novelwriter.dialogs.quotes import GuiQuoteSelect
+1 -1
View File
@@ -22,7 +22,7 @@ from __future__ import annotations
import pytest
from PyQt5.QtCore import Qt
from PyQt6.QtCore import Qt
from novelwriter.dialogs.docmerge import GuiDocMerge
from novelwriter.types import QtAccepted, QtRejected, QtUserRole
+3 -3
View File
@@ -22,9 +22,9 @@ from __future__ import annotations
import pytest
from PyQt5.QtCore import QEvent, Qt
from PyQt5.QtGui import QFont, QFontDatabase, QKeyEvent
from PyQt5.QtWidgets import QAction, QFileDialog, QFontDialog
from PyQt6.QtCore import QEvent, Qt
from PyQt6.QtGui import QAction, QFont, QFontDatabase, QKeyEvent
from PyQt6.QtWidgets import QFileDialog, QFontDialog
from novelwriter import CONFIG, SHARED
from novelwriter.constants import nwUnicode
@@ -22,8 +22,8 @@ from __future__ import annotations
import pytest
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QAction, QColorDialog, QFileDialog
from PyQt6.QtGui import QAction, QColor
from PyQt6.QtWidgets import QColorDialog, QFileDialog
from novelwriter import CONFIG, SHARED
from novelwriter.dialogs.editlabel import GuiEditLabel
+5 -4
View File
@@ -22,8 +22,9 @@ from __future__ import annotations
import pytest
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QAction, QFileDialog
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QAction
from PyQt6.QtWidgets import QFileDialog
from novelwriter import SHARED
from novelwriter.core.spellcheck import UserDictionary
@@ -104,11 +105,11 @@ def testDlgWordList_Dialog(qtbot, monkeypatch, nwGUI, fncPath, projPath):
wList._doAdd()
assert wList.listBox.item(0).text() == "delete_me" # type: ignore
delItem = wList.listBox.findItems("delete_me", Qt.MatchExactly)[0]
delItem = wList.listBox.findItems("delete_me", Qt.MatchFlag.MatchExactly)[0]
assert delItem.text() == "delete_me"
delItem.setSelected(True)
wList._doDelete()
assert wList.listBox.findItems("delete_me", Qt.MatchExactly) == []
assert wList.listBox.findItems("delete_me", Qt.MatchFlag.MatchExactly) == []
assert wList.listBox.item(0).text() == "word_a" # type: ignore
# Import/Export