diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-11-28 10:56:58 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-11-28 11:43:03 +0100 |
| commit | ea5ce2e4080a99c43b9a330e34588fb1f25c7e45 (patch) | |
| tree | 603f71391656bfde3690fe18b916cd4bf0ef2ad1 /sources/pyside6/tests/pysidetest/multiple_inheritance_test.py | |
| parent | 3ad6f139ddd792b24e8c15c847f3e5db3eac3bf3 (diff) | |
Tests: Fix some flake warnings
Mostly spacing related.
Pick-to: 6.6
Change-Id: I748a8a06f456c5d4bafb94c397c43b3b2ee9e3e9
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/tests/pysidetest/multiple_inheritance_test.py')
| -rw-r--r-- | sources/pyside6/tests/pysidetest/multiple_inheritance_test.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py b/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py index 033a065ab..fe8e14f9f 100644 --- a/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py +++ b/sources/pyside6/tests/pysidetest/multiple_inheritance_test.py @@ -19,6 +19,7 @@ def xprint(*args, **kw): if "-v" in sys.argv: print(*args, **kw) + # This is the original testcase of PYSIDE-1564 class Age(object): def __init__(self, age=0, **kwds): @@ -26,6 +27,7 @@ class Age(object): self.age = age + class Person(QtCore.QObject, Age): def __init__(self, name, **kwds): super().__init__(**kwds) @@ -43,6 +45,7 @@ class OriginalMultipleInheritanceTest(unittest.TestCase): # More tests follow: + # mro ('C', 'A', 'QObject', 'Object', 'B', 'object') class A(QtCore.QObject): def __init__(self, anna=77, **kw): @@ -50,6 +53,7 @@ class A(QtCore.QObject): super().__init__(**kw) xprint('A: after init') + class B: def __init__(self, otto=6, age=7, **kw): xprint(f'B: before init kw = {kw}') @@ -59,12 +63,14 @@ class B: self.age = age xprint('B: after init') + class C(A, B): def __init__(self, **kw): xprint(f'C: before init kw = {kw}') super().__init__(**kw) xprint('C: after init') + # mro ('F', 'D', 'QCursor', 'E', 'QLabel', 'QFrame', 'QWidget', 'QObject', 'QPaintDevice', 'Object', 'object') class D(QtGui.QCursor): def __init__(self, anna=77, **kw): @@ -72,6 +78,7 @@ class D(QtGui.QCursor): super().__init__(**kw) xprint('D: after init') + class E: def __init__(self, age=7, **kw): xprint(f'E: before init kw = {kw}') @@ -79,17 +86,20 @@ class E: self.age = age xprint('E: after init') + class F(D, E, QtWidgets.QLabel): def __init__(self, **kw): xprint(f'F: before init kw = {kw}') super().__init__(**kw) xprint('F: after init') + # mro ('I', 'G', 'QTextDocument', 'H', 'QLabel', 'QFrame', 'QWidget', 'QObject', 'QPaintDevice', 'Object', 'object') # Similar, but this time we want to reach `H` without support from `super`. class G(QtGui.QTextDocument): pass + class H: def __init__(self, age=7, **kw): xprint(f'H: before init kw = {kw}') @@ -97,6 +107,7 @@ class H: self.age = age xprint('H: after init') + class I(G, H, QtWidgets.QLabel): pass @@ -108,6 +119,7 @@ class Ui_X_MainWindow(object): # Emulating uic MainWindow.resize(400, 300) self.lbl = QLabel(self) + class MainWindow(QMainWindow, Ui_X_MainWindow): def __init__(self, parent=None): super().__init__(parent) @@ -122,7 +134,7 @@ class AdditionalMultipleInheritanceTest(UsesQApplication): self.assertEqual(res.age, 7) xprint() with self.assertRaises(AssertionError): - res=C(killme=42) + res = C(killme=42) xprint() def testDEF(self): |
