| 1 |
Author: Michael R. Crusoe <[email protected]> |
| 2 |
Description: Fix test for PyQT6 |
| 3 |
Forwarded: not-needed |
| 4 |
--- python-pymeasure.orig/tests/display/test_inputs.py |
| 5 |
+++ python-pymeasure/tests/display/test_inputs.py |
| 6 |
@@ -241,8 +241,8 @@ |
| 7 |
p.assert_called_once_with(5.0) |
| 8 |
|
| 9 |
@pytest.mark.parametrize("locale, decimalSep", [ |
| 10 |
- [QtCore.QLocale(31, 7, 224), "."], # UK locale for period |
| 11 |
- [QtCore.QLocale(30, 7, 151), ","], # NL locale for comma |
| 12 |
+ [QtCore.QLocale(QtCore.QLocale.Language.English, QtCore.QLocale.Script.LatinScript, QtCore.QLocale.Country.UnitedKingdom), "."], # UK locale for period |
| 13 |
+ [QtCore.QLocale(QtCore.QLocale.Language.Dutch, QtCore.QLocale.Script.LatinScript, QtCore.QLocale.Country.Netherlands), ","], # NL locale for comma |
| 14 |
]) |
| 15 |
def test_locale_settings(self, qtbot, locale, decimalSep): |
| 16 |
assert locale.decimalPoint() == decimalSep |
| 17 |
--- python-pymeasure.orig/tests/display/widgets/test_inputs_widget.py |
| 18 |
+++ python-pymeasure/tests/display/widgets/test_inputs_widget.py |
| 19 |
@@ -54,14 +54,14 @@ |
| 20 |
assert wdg.x.isVisibleTo(wdg) is True |
| 21 |
assert wdg.x.isEnabled() is True |
| 22 |
|
| 23 |
- qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.LeftButton, |
| 24 |
+ qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.MouseButton.LeftButton, |
| 25 |
pos=QtCore.QPoint(2, int(wdg.toggle_par.height()/2))) |
| 26 |
|
| 27 |
assert wdg.toggle_par.isChecked() is False |
| 28 |
assert wdg.x.isVisibleTo(wdg) is exp_visible |
| 29 |
assert wdg.x.isEnabled() is exp_enabled |
| 30 |
|
| 31 |
- qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.LeftButton, |
| 32 |
+ qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.MouseButton.LeftButton, |
| 33 |
pos=QtCore.QPoint(2, int(wdg.toggle_par.height()/2))) |
| 34 |
|
| 35 |
assert wdg.toggle_par.isChecked() is True |
| 36 |
@@ -86,7 +86,7 @@ |
| 37 |
assert wdg.toggle_par.isChecked() is False |
| 38 |
assert wdg.x.isVisibleTo(wdg) is False |
| 39 |
|
| 40 |
- qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.LeftButton, |
| 41 |
+ qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.MouseButton.LeftButton, |
| 42 |
pos=QtCore.QPoint(2, int(wdg.toggle_par.height()/2))) |
| 43 |
|
| 44 |
assert wdg.toggle_par.isChecked() is True |
| 45 |
@@ -109,28 +109,28 @@ |
| 46 |
assert wdg.toggle_par2.isChecked() is False |
| 47 |
assert wdg.x.isVisibleTo(wdg) is True |
| 48 |
|
| 49 |
- qtbot.mouseClick(wdg.toggle_par1, QtCore.Qt.LeftButton, |
| 50 |
+ qtbot.mouseClick(wdg.toggle_par1, QtCore.Qt.MouseButton.LeftButton, |
| 51 |
pos=QtCore.QPoint(2, int(wdg.toggle_par1.height()/2))) |
| 52 |
|
| 53 |
assert wdg.toggle_par1.isChecked() is False |
| 54 |
assert wdg.toggle_par2.isChecked() is False |
| 55 |
assert wdg.x.isVisibleTo(wdg) is False |
| 56 |
|
| 57 |
- qtbot.mouseClick(wdg.toggle_par2, QtCore.Qt.LeftButton, |
| 58 |
+ qtbot.mouseClick(wdg.toggle_par2, QtCore.Qt.MouseButton.LeftButton, |
| 59 |
pos=QtCore.QPoint(2, int(wdg.toggle_par2.height()/2))) |
| 60 |
|
| 61 |
assert wdg.toggle_par1.isChecked() is False |
| 62 |
assert wdg.toggle_par2.isChecked() is True |
| 63 |
assert wdg.x.isVisibleTo(wdg) is False |
| 64 |
|
| 65 |
- qtbot.mouseClick(wdg.toggle_par1, QtCore.Qt.LeftButton, |
| 66 |
+ qtbot.mouseClick(wdg.toggle_par1, QtCore.Qt.MouseButton.LeftButton, |
| 67 |
pos=QtCore.QPoint(2, int(wdg.toggle_par1.height()/2))) |
| 68 |
|
| 69 |
assert wdg.toggle_par1.isChecked() is True |
| 70 |
assert wdg.toggle_par2.isChecked() is True |
| 71 |
assert wdg.x.isVisibleTo(wdg) is False |
| 72 |
|
| 73 |
- qtbot.mouseClick(wdg.toggle_par2, QtCore.Qt.LeftButton, |
| 74 |
+ qtbot.mouseClick(wdg.toggle_par2, QtCore.Qt.MouseButton.LeftButton, |
| 75 |
pos=QtCore.QPoint(2, int(wdg.toggle_par2.height()/2))) |
| 76 |
|
| 77 |
assert wdg.toggle_par1.isChecked() is True |
| 78 |
@@ -157,13 +157,13 @@ |
| 79 |
assert wdg.toggle_par.isChecked() is True |
| 80 |
assert wdg.x.isVisibleTo(wdg) is condition |
| 81 |
|
| 82 |
- qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.LeftButton, |
| 83 |
+ qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.MouseButton.LeftButton, |
| 84 |
pos=QtCore.QPoint(2, int(wdg.toggle_par.height()/2))) |
| 85 |
|
| 86 |
assert wdg.toggle_par.isChecked() is False |
| 87 |
assert wdg.x.isVisibleTo(wdg) is not condition |
| 88 |
|
| 89 |
- qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.LeftButton, |
| 90 |
+ qtbot.mouseClick(wdg.toggle_par, QtCore.Qt.MouseButton.LeftButton, |
| 91 |
pos=QtCore.QPoint(2, int(wdg.toggle_par.height()/2))) |
| 92 |
|
| 93 |
assert wdg.toggle_par.isChecked() is True |