Fix warnings in tests

This commit is contained in:
Veronica Berglyd Olsen
2025-01-13 19:43:04 +01:00
parent 72ed5d84f6
commit 0b7c31b6a9
11 changed files with 336 additions and 102 deletions
+10 -3
View File
@@ -96,6 +96,7 @@ def testDlgPreferences_Actions(qtbot, monkeypatch, nwGUI):
# Check Navigation
vBar = prefs.mainForm.verticalScrollBar()
assert vBar is not None
old = -1
with qtbot.waitSignal(vBar.valueChanged) as value:
prefs.sidebar.button(1).click()
@@ -119,12 +120,16 @@ def testDlgPreferences_Actions(qtbot, monkeypatch, nwGUI):
# Check Save Button
prefs.show()
with qtbot.waitSignal(prefs.newPreferencesReady) as signal:
prefs.buttonBox.button(QtDialogSave).click()
button = prefs.buttonBox.button(QtDialogSave)
assert button is not None
button.click()
assert signal.args == [False, False, False, False]
# Check Close Button
prefs.show()
prefs.buttonBox.button(QtDialogCancel).click()
button = prefs.buttonBox.button(QtDialogCancel)
assert button is not None
button.click()
assert prefs.isHidden() is True
# Close Using Escape Key
@@ -313,7 +318,9 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths):
with monkeypatch.context() as mp:
mp.setattr(QFontDatabase, "families", lambda *a: ["TestFont"])
with qtbot.waitSignal(prefs.newPreferencesReady) as signal:
prefs.buttonBox.button(QtDialogSave).click()
button = prefs.buttonBox.button(QtDialogSave)
assert button is not None
button.click()
assert signal.args == [True, True, True, True]
# Check Settings