aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtUiTools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-29 11:18:49 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-29 15:56:58 +0200
commit6d2af409eedee377b3c2ba0cd8156b9409fabd9d (patch)
tree660f8fd87f77c1030cf97cc65345b9a941a321e4 /sources/pyside6/tests/QtUiTools
parent88fff87519e741a3a999b8c1545834d116859faa (diff)
Tests: Fix some space-related flake8 warnings
Change-Id: I9b0ad08839bf1246620c557ec304dfa90882907b Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/tests/QtUiTools')
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_1060.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_360.py2
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_376.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_392.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_426.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_552.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_909.py2
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_913.py5
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_958.py4
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_965.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/loadUiType_test.py1
-rw-r--r--sources/pyside6/tests/QtUiTools/ui_test.py2
-rw-r--r--sources/pyside6/tests/QtUiTools/uiloader_test.py1
13 files changed, 23 insertions, 4 deletions
diff --git a/sources/pyside6/tests/QtUiTools/bug_1060.py b/sources/pyside6/tests/QtUiTools/bug_1060.py
index c5d8e61b3..db201f40a 100644
--- a/sources/pyside6/tests/QtUiTools/bug_1060.py
+++ b/sources/pyside6/tests/QtUiTools/bug_1060.py
@@ -47,6 +47,7 @@ class MyQUiLoader(QUiLoader):
def createWidget(self, *args):
return super(MyQUiLoader, self).createWidget(*args)
+
if __name__ == "__main__":
app = QApplication([])
diff --git a/sources/pyside6/tests/QtUiTools/bug_360.py b/sources/pyside6/tests/QtUiTools/bug_360.py
index 230afb965..b4890f0e3 100644
--- a/sources/pyside6/tests/QtUiTools/bug_360.py
+++ b/sources/pyside6/tests/QtUiTools/bug_360.py
@@ -55,6 +55,7 @@ class MyQUiLoader(QUiLoader):
setattr(self.baseinstance, name, widget)
return widget
+
class ButTest(UsesQApplication):
def testCase(self):
w = QWidget()
@@ -66,6 +67,7 @@ class ButTest(UsesQApplication):
self.assertEqual(len(loader._widgets), 1)
self.assertEqual(type(loader._widgets[0]), QFrame)
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/bug_376.py b/sources/pyside6/tests/QtUiTools/bug_376.py
index 68138731c..f299fabc4 100644
--- a/sources/pyside6/tests/QtUiTools/bug_376.py
+++ b/sources/pyside6/tests/QtUiTools/bug_376.py
@@ -50,6 +50,7 @@ class BugTest(UsesQApplication):
result = loader.load(filePath, w)
self.assertTrue(isinstance(result.child_object, QFrame))
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/bug_392.py b/sources/pyside6/tests/QtUiTools/bug_392.py
index eb351dedc..0211ad3ba 100644
--- a/sources/pyside6/tests/QtUiTools/bug_392.py
+++ b/sources/pyside6/tests/QtUiTools/bug_392.py
@@ -41,6 +41,7 @@ from PySide6.QtGui import QAction
from PySide6.QtWidgets import QComboBox, QWidget
from PySide6.QtUiTools import QUiLoader
+
class MyWidget(QComboBox):
def __init__(self, parent=None):
QComboBox.__init__(self, parent)
@@ -48,6 +49,7 @@ class MyWidget(QComboBox):
def isPython(self):
return True
+
class BugTest(UsesQApplication):
def testCase(self):
w = QWidget()
@@ -80,6 +82,7 @@ class BugTest(UsesQApplication):
self.assertTrue(isinstance(result.custom2, MyWidget))
self.assertTrue(result.custom.isPython())
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/bug_426.py b/sources/pyside6/tests/QtUiTools/bug_426.py
index 9f9ca2a1e..3fdc9bec4 100644
--- a/sources/pyside6/tests/QtUiTools/bug_426.py
+++ b/sources/pyside6/tests/QtUiTools/bug_426.py
@@ -50,6 +50,7 @@ class Window(object):
self.widget.show()
QTimer.singleShot(0, self.widget.close)
+
if __name__ == "__main__":
app = QApplication(sys.argv)
win = Window()
diff --git a/sources/pyside6/tests/QtUiTools/bug_552.py b/sources/pyside6/tests/QtUiTools/bug_552.py
index 345dfbac6..d79913424 100644
--- a/sources/pyside6/tests/QtUiTools/bug_552.py
+++ b/sources/pyside6/tests/QtUiTools/bug_552.py
@@ -54,6 +54,7 @@ class View_1(QWidget):
self.t = widget.tabWidget
self.t.removeTab(0)
+
app = QApplication([])
window = View_1()
window.show()
diff --git a/sources/pyside6/tests/QtUiTools/bug_909.py b/sources/pyside6/tests/QtUiTools/bug_909.py
index ce963f31f..96e1d1fa8 100644
--- a/sources/pyside6/tests/QtUiTools/bug_909.py
+++ b/sources/pyside6/tests/QtUiTools/bug_909.py
@@ -41,6 +41,7 @@ from PySide6.QtUiTools import QUiLoader
from helper.usesqapplication import UsesQApplication
+
class TestDestruction(UsesQApplication):
def testBug909(self):
file = Path(__file__).resolve().parent / 'bug_909.ui'
@@ -55,5 +56,6 @@ class TestDestruction(UsesQApplication):
main_win.setCentralWidget(tw)
main_win.show()
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/bug_913.py b/sources/pyside6/tests/QtUiTools/bug_913.py
index 20c3555ac..9128969d8 100644
--- a/sources/pyside6/tests/QtUiTools/bug_913.py
+++ b/sources/pyside6/tests/QtUiTools/bug_913.py
@@ -51,8 +51,9 @@ class TestBug913 (unittest.TestCase):
file = Path(__file__).resolve().parent / 'bug_913.ui'
self.assertTrue(file.is_file())
widget = loader.load(os.fspath(file))
- widget.tabWidget.currentIndex() # direct child is available as member
- widget.le_first.setText('foo') # child of QTabWidget must also be available!
+ widget.tabWidget.currentIndex() # direct child is available as member
+ widget.le_first.setText('foo') # child of QTabWidget must also be available!
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/bug_958.py b/sources/pyside6/tests/QtUiTools/bug_958.py
index 2ef9b4331..74c4a18ea 100644
--- a/sources/pyside6/tests/QtUiTools/bug_958.py
+++ b/sources/pyside6/tests/QtUiTools/bug_958.py
@@ -49,15 +49,17 @@ class Gui_Qt(QMainWindow):
# this used to cause a segfault because the old inject code used to destroy the parent layout
file = Path(__file__).resolve().parent / 'bug_958.ui'
assert(file.is_file())
- self._cw = lLoader.load(os.fspath(file), self)
+ self._cw = lLoader.load(os.fspath(file), self)
self.setCentralWidget(self._cw)
+
class BugTest(TimedQApplication):
def testCase(self):
lMain = Gui_Qt()
lMain.show()
self.app.exec_()
+
if __name__ == "__main__":
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/bug_965.py b/sources/pyside6/tests/QtUiTools/bug_965.py
index 734158f68..92da3312a 100644
--- a/sources/pyside6/tests/QtUiTools/bug_965.py
+++ b/sources/pyside6/tests/QtUiTools/bug_965.py
@@ -39,6 +39,7 @@ from PySide6.QtUiTools import QUiLoader
from helper.usesqapplication import UsesQApplication
+
class MyQUiLoader(QUiLoader):
def __init__(self):
super().__init__()
@@ -46,6 +47,7 @@ class MyQUiLoader(QUiLoader):
def createWidget(self, className, parent=None, name=""):
return None
+
class BugTest(UsesQApplication):
def testCase(self):
loader = MyQUiLoader()
@@ -53,5 +55,6 @@ class BugTest(UsesQApplication):
self.assertTrue(file.is_file())
self.assertRaises(RuntimeError, loader.load, os.fspath(file))
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/loadUiType_test.py b/sources/pyside6/tests/QtUiTools/loadUiType_test.py
index 1fe30b79e..44de5b6d2 100644
--- a/sources/pyside6/tests/QtUiTools/loadUiType_test.py
+++ b/sources/pyside6/tests/QtUiTools/loadUiType_test.py
@@ -40,6 +40,7 @@ from helper.usesqapplication import UsesQApplication
from PySide6.QtWidgets import QWidget, QFrame, QPushButton
from PySide6.QtUiTools import loadUiType
+
class loadUiTypeTester(UsesQApplication):
def testFunction(self):
filePath = os.path.join(os.path.dirname(__file__), "minimal.ui")
diff --git a/sources/pyside6/tests/QtUiTools/ui_test.py b/sources/pyside6/tests/QtUiTools/ui_test.py
index 70b916b44..553e9192d 100644
--- a/sources/pyside6/tests/QtUiTools/ui_test.py
+++ b/sources/pyside6/tests/QtUiTools/ui_test.py
@@ -39,10 +39,12 @@ from PySide6.QtUiTools import QUiLoader
from helper.usesqapplication import UsesQApplication
+
class QUiLoaderCreation(UsesQApplication):
def testConstructor(self):
loader = QUiLoader()
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/pyside6/tests/QtUiTools/uiloader_test.py b/sources/pyside6/tests/QtUiTools/uiloader_test.py
index 3e02e41d4..bc0fd93c7 100644
--- a/sources/pyside6/tests/QtUiTools/uiloader_test.py
+++ b/sources/pyside6/tests/QtUiTools/uiloader_test.py
@@ -67,7 +67,6 @@ class QUiLoaderTester(UsesQApplication):
self.assertNotEqual(child, None)
self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object"))
-
def testLoadFileOverride(self):
# PYSIDE-1070, override QUiLoader::createWidget() with parent=None crashes
loader = OverridingLoader()