aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-16 10:29:57 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-04-16 10:30:04 +0200
commit2156651b39fbb6717ed936c94dcd28295436e0a4 (patch)
treecfa99c89541488bf42c5709c95e33df2149a6fe0 /sources/pyside2/tests
parent9cc6c201c701b4ebba9344a9f9f0a1d456c5ebee (diff)
parentc36553a1fe425fa9575c1b1b8b96c1d427b65fcd (diff)
Merge remote-tracking branch 'origin/5.9' into 5.11
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r--sources/pyside2/tests/QtGui/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtGui/bug_300_test.py3
-rw-r--r--sources/pyside2/tests/QtGui/bug_716.py3
-rw-r--r--sources/pyside2/tests/QtPrintSupport/CMakeLists.txt3
-rw-r--r--sources/pyside2/tests/QtPrintSupport/bug_500.py (renamed from sources/pyside2/tests/QtGui/bug_500.py)0
-rw-r--r--sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py (renamed from sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py)20
-rw-r--r--sources/pyside2/tests/QtTest/CMakeLists.txt1
-rw-r--r--sources/pyside2/tests/QtTest/qvalidator_test.py (renamed from sources/pyside2/tests/QtWidgets/qvalidator_test.py)0
-rw-r--r--sources/pyside2/tests/QtWidgets/CMakeLists.txt2
9 files changed, 19 insertions, 14 deletions
diff --git a/sources/pyside2/tests/QtGui/CMakeLists.txt b/sources/pyside2/tests/QtGui/CMakeLists.txt
index eeb7c7e36..b487a2401 100644
--- a/sources/pyside2/tests/QtGui/CMakeLists.txt
+++ b/sources/pyside2/tests/QtGui/CMakeLists.txt
@@ -3,7 +3,6 @@
PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(bug_367.py)
PYSIDE_TEST(bug_480.py)
-PYSIDE_TEST(bug_500.py)
PYSIDE_TEST(bug_606.py)
PYSIDE_TEST(bug_617.py)
PYSIDE_TEST(bug_652.py)
diff --git a/sources/pyside2/tests/QtGui/bug_300_test.py b/sources/pyside2/tests/QtGui/bug_300_test.py
index 1ab71569a..e8adca014 100644
--- a/sources/pyside2/tests/QtGui/bug_300_test.py
+++ b/sources/pyside2/tests/QtGui/bug_300_test.py
@@ -26,8 +26,7 @@
##
#############################################################################
-from PySide2.QtGui import QStringListModel
-from PySide2.QtCore import QModelIndex
+from PySide2.QtCore import QModelIndex, QStringListModel
import unittest
class TestQAbstractItemModelSignals(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/bug_716.py b/sources/pyside2/tests/QtGui/bug_716.py
index 49a329bc2..8bf07d6e2 100644
--- a/sources/pyside2/tests/QtGui/bug_716.py
+++ b/sources/pyside2/tests/QtGui/bug_716.py
@@ -26,8 +26,7 @@
##
#############################################################################
-from PySide2.QtCore import Qt, QPersistentModelIndex
-from PySide2.QtGui import QStringListModel
+from PySide2.QtCore import Qt, QPersistentModelIndex, QStringListModel
if __name__ == '__main__':
stringListModel = QStringListModel(['one', 'two'])
diff --git a/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt b/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt
index 2f7cb08b9..510c5fe0b 100644
--- a/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt
+++ b/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt
@@ -1 +1,2 @@
-# Please add some tests, here
+PYSIDE_TEST(bug_500.py)
+PYSIDE_TEST(returnquadruplesofnumbers_test.py)
diff --git a/sources/pyside2/tests/QtGui/bug_500.py b/sources/pyside2/tests/QtPrintSupport/bug_500.py
index b6f941633..b6f941633 100644
--- a/sources/pyside2/tests/QtGui/bug_500.py
+++ b/sources/pyside2/tests/QtPrintSupport/bug_500.py
diff --git a/sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py b/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
index 6e4cfeb63..f6f2490f0 100644
--- a/sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py
+++ b/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
@@ -30,7 +30,7 @@ from __future__ import print_function
import unittest
from PySide2.QtGui import QTextCursor
-from PySide2.QtPrintSupport import QPrinter
+from PySide2.QtPrintSupport import QPrinter, QPrinterInfo
from PySide2.QtWidgets import QLayout, QWidget, QGraphicsLayout, QGraphicsLayoutItem
from helper import UsesQApplication
@@ -81,14 +81,22 @@ class ReturnsQuadruplesOfNumbers(UsesQApplication):
self.assertEqual(obj.selectedTableCells(), (-1, -1, -1, -1))
def testQPrinterGetPageMargins(self):
- # Bug #742
- obj = QPrinter()
+ # Bug #742. Find a printer like PDF/XPS on which arbitrary margins can be set.
+ printer = None
+ for printerInfo in QPrinterInfo.availablePrinters():
+ name = printerInfo.printerName().lower()
+ if "xps" in name or "pdf" in name:
+ printer = QPrinter(printerInfo)
+ break
+ if not printer:
+ printer = QPrinter()
# On macOS the minimum margin of a page is ~12, setting something lower than that will
# actually fail to set all the margins.
values = (15.0, 16.0, 17.0, 18.0, QPrinter.Point)
- obj.setPageMargins(*values)
- print(obj.getPageMargins(QPrinter.Point), values[:-1])
- self.assertTrue(self.compareTuples(obj.getPageMargins(QPrinter.Point), values[:-1]))
+ printer.setPageMargins(*values)
+ actual = printer.getPageMargins(QPrinter.Point)
+ print(printer.printerName(), actual, values[:-1])
+ self.assertTrue(self.compareTuples(actual, values[:-1]))
if __name__ == "__main__":
unittest.main()
diff --git a/sources/pyside2/tests/QtTest/CMakeLists.txt b/sources/pyside2/tests/QtTest/CMakeLists.txt
index 2a95b70f7..cf72dfa5c 100644
--- a/sources/pyside2/tests/QtTest/CMakeLists.txt
+++ b/sources/pyside2/tests/QtTest/CMakeLists.txt
@@ -2,3 +2,4 @@ PYSIDE_TEST(click_test.py)
PYSIDE_TEST(eventfilter_test.py)
# The test is currently permanently broken, needs to be fixed.
#PYSIDE_TEST(touchevent_test.py)
+PYSIDE_TEST(qvalidator_test.py)
diff --git a/sources/pyside2/tests/QtWidgets/qvalidator_test.py b/sources/pyside2/tests/QtTest/qvalidator_test.py
index dd5eaadb3..dd5eaadb3 100644
--- a/sources/pyside2/tests/QtWidgets/qvalidator_test.py
+++ b/sources/pyside2/tests/QtTest/qvalidator_test.py
diff --git a/sources/pyside2/tests/QtWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWidgets/CMakeLists.txt
index 4efd9d803..fa64d1c3b 100644
--- a/sources/pyside2/tests/QtWidgets/CMakeLists.txt
+++ b/sources/pyside2/tests/QtWidgets/CMakeLists.txt
@@ -123,13 +123,11 @@ PYSIDE_TEST(qtextedit_signal_test.py)
PYSIDE_TEST(qtreeview_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
-PYSIDE_TEST(qvalidator_test.py)
PYSIDE_TEST(qvariant_test.py)
PYSIDE_TEST(qwidget_setlayout_test.py)
PYSIDE_TEST(qwidget_test.py)
PYSIDE_TEST(qcolormap_test.py)
PYSIDE_TEST(reference_count_test.py)
-PYSIDE_TEST(returnquadruplesofnumbers_test.py)
PYSIDE_TEST(standardpixmap_test.py)
PYSIDE_TEST(test_module_template.py)
PYSIDE_TEST(virtual_protected_inheritance_test.py)