aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtGui
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-27 08:22:07 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-27 15:30:14 +0200
commit70ffe0b5136cfce75c94fa09cd6070b7270f684d (patch)
tree4b22b5d9d7b055340a723d41e2f88fcac212f143 /sources/pyside6/tests/QtGui
parent8245dd6356dbb0124a7477b16f19e5f031074f85 (diff)
Tests: Use per-class imports
Change-Id: I6dac1f54152fecab7af6831bc3c813a016408aae Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/tests/QtGui')
-rw-r--r--sources/pyside6/tests/QtGui/bug_1091.py7
-rw-r--r--sources/pyside6/tests/QtGui/bug_367.py7
-rw-r--r--sources/pyside6/tests/QtGui/bug_480.py14
3 files changed, 16 insertions, 12 deletions
diff --git a/sources/pyside6/tests/QtGui/bug_1091.py b/sources/pyside6/tests/QtGui/bug_1091.py
index 22788fea0..1e5ae4ce6 100644
--- a/sources/pyside6/tests/QtGui/bug_1091.py
+++ b/sources/pyside6/tests/QtGui/bug_1091.py
@@ -37,12 +37,13 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide6 import QtGui
+from PySide6.QtGui import QPainter
+
class QPainterTestCase(unittest.TestCase):
def testIt(self):
- self.assertTrue("PixmapFragment" in dir(QtGui.QPainter))
- self.assertTrue("drawPixmapFragments" in dir(QtGui.QPainter))
+ self.assertTrue("PixmapFragment" in dir(QPainter))
+ self.assertTrue("drawPixmapFragments" in dir(QPainter))
if __name__ == "__main__":
unittest.main()
diff --git a/sources/pyside6/tests/QtGui/bug_367.py b/sources/pyside6/tests/QtGui/bug_367.py
index 0fd676d8b..2dfc140f4 100644
--- a/sources/pyside6/tests/QtGui/bug_367.py
+++ b/sources/pyside6/tests/QtGui/bug_367.py
@@ -38,14 +38,15 @@ from init_paths import init_test_paths
init_test_paths(False)
from helper.usesqapplication import UsesQApplication
-from PySide6 import QtCore,QtGui
+from PySide6.QtGui import QStandardItem, QStandardItemModel
+
class BugTest(UsesQApplication):
def testCase(self):
- model = QtGui.QStandardItemModel()
+ model = QStandardItemModel()
parentItem = model.invisibleRootItem()
for i in range(10):
- item = QtGui.QStandardItem()
+ item = QStandardItem()
rcount = sys.getrefcount(item)
parentItem.appendRow(item)
self.assertEqual(rcount+1, sys.getrefcount(item))
diff --git a/sources/pyside6/tests/QtGui/bug_480.py b/sources/pyside6/tests/QtGui/bug_480.py
index a7c863ba6..39707fb01 100644
--- a/sources/pyside6/tests/QtGui/bug_480.py
+++ b/sources/pyside6/tests/QtGui/bug_480.py
@@ -35,13 +35,15 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide6 import QtWidgets
+from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QVBoxLayout,
+ QWidget)
-class BuggyWidget(QtWidgets.QWidget):
+
+class BuggyWidget(QWidget):
def setup(self):
- self.verticalLayout = QtWidgets.QVBoxLayout(self)
- self.gridLayout = QtWidgets.QGridLayout()
- self.lbl = QtWidgets.QLabel(self)
+ self.verticalLayout = QVBoxLayout(self)
+ self.gridLayout = QGridLayout()
+ self.lbl = QLabel(self)
self.gridLayout.addWidget(self.lbl, 0, 1, 1, 1)
# this cause a segfault during the ownership transfer
@@ -49,7 +51,7 @@ class BuggyWidget(QtWidgets.QWidget):
class LayoutTransferOwnerShip(unittest.TestCase):
def testBug(self):
- app = QtWidgets.QApplication([])
+ app = QApplication([])
w = BuggyWidget()
w.setup()
w.show()