Switch test code to PyQt6
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user