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/QtCore | |
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/QtCore')
9 files changed, 13 insertions, 13 deletions
diff --git a/sources/pyside6/tests/QtCore/bug_515.py b/sources/pyside6/tests/QtCore/bug_515.py index 52293b808..4e270a441 100644 --- a/sources/pyside6/tests/QtCore/bug_515.py +++ b/sources/pyside6/tests/QtCore/bug_515.py @@ -26,7 +26,7 @@ def _cleanup(): def _checkCleanup(): global callCleanup - assert(callCleanup) + assert (callCleanup) app = QCoreApplication([]) diff --git a/sources/pyside6/tests/QtCore/classinfo_test.py b/sources/pyside6/tests/QtCore/classinfo_test.py index 30d141acf..0b0a0b4b6 100644 --- a/sources/pyside6/tests/QtCore/classinfo_test.py +++ b/sources/pyside6/tests/QtCore/classinfo_test.py @@ -33,7 +33,7 @@ class TestClassInfo(unittest.TestCase): self.assertEqual(ci.value(), 'http://www.pyside.org') def test_dictionary(self): - @ClassInfo({'author':'pyside', 'author company':'The Qt Company'}) + @ClassInfo({'author': 'pyside', 'author company': 'The Qt Company'}) class MyObject(QObject): pass @@ -50,11 +50,11 @@ class TestClassInfo(unittest.TestCase): self.assertEqual(ci.value(), 'The Qt Company') def test_verify_metadata_types(self): - valid_dict = { '123': '456' } + valid_dict = {'123': '456'} - invalid_dict_1 = { '123': 456 } - invalid_dict_2 = { 123: 456 } - invalid_dict_3 = { 123: '456' } + invalid_dict_1 = {'123': 456} + invalid_dict_2 = {123: 456} + invalid_dict_3 = {123: '456'} ClassInfo(**valid_dict) @@ -88,6 +88,7 @@ class TestClassInfo(unittest.TestCase): def test_can_only_be_used_on_qobjects(self): def make_info(): return ClassInfo(author='pyside') + def test_function(): pass self.assertRaises(TypeError, make_info(), test_function) diff --git a/sources/pyside6/tests/QtCore/feature_with_uic/window.py b/sources/pyside6/tests/QtCore/feature_with_uic/window.py index 6632fbaf9..c55bcaf92 100644 --- a/sources/pyside6/tests/QtCore/feature_with_uic/window.py +++ b/sources/pyside6/tests/QtCore/feature_with_uic/window.py @@ -28,7 +28,6 @@ class Ui_MainWindow(object): self.verticalLayout.addWidget(self.pushButton) - self.horizontalLayout.addLayout(self.verticalLayout) MainWindow.setCentralWidget(self.centralwidget) diff --git a/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py b/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py index fa85d95ef..a808f0c3d 100644 --- a/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py +++ b/sources/pyside6/tests/QtCore/loggingcategorymacros_test.py @@ -17,6 +17,7 @@ from PySide6.QtCore import (QLoggingCategory, QtMsgType, qCDebug, qCWarning, qCI param = None + def handler(msgt, ctx, msg): global param param = ctx.category + ": " + msg.strip() @@ -70,7 +71,6 @@ class TestQLoggingCategory(unittest.TestCase): qCWarning(self.criticalCategory, f"devices: {self.no_devices}") self.assertEqual(param, "warning.log: devices: 2") - def test_qCritical(self): qCCritical(self.defaultCategory, "no device") self.assertEqual(param, "default: no device") diff --git a/sources/pyside6/tests/QtCore/multiple_feature_test.py b/sources/pyside6/tests/QtCore/multiple_feature_test.py index 4b6b05664..0f51ace6b 100644 --- a/sources/pyside6/tests/QtCore/multiple_feature_test.py +++ b/sources/pyside6/tests/QtCore/multiple_feature_test.py @@ -30,6 +30,7 @@ There is much more to come. MethodDescriptorType = type(str.split) + def xprint(*args, **kw): if "-v" in sys.argv: print(*args, **kw) diff --git a/sources/pyside6/tests/QtCore/qcbor_test.py b/sources/pyside6/tests/QtCore/qcbor_test.py index 6c7606dd2..312c9e5c7 100644 --- a/sources/pyside6/tests/QtCore/qcbor_test.py +++ b/sources/pyside6/tests/QtCore/qcbor_test.py @@ -15,7 +15,7 @@ from init_paths import init_test_paths init_test_paths(False) from PySide6.QtCore import (QByteArray, QCborStreamReader, QCborStreamWriter, - QCborTag, QCborValue) + QCborTag, QCborValue) class TestCbor(unittest.TestCase): diff --git a/sources/pyside6/tests/QtCore/qobject_parent_test.py b/sources/pyside6/tests/QtCore/qobject_parent_test.py index 160426b01..6265f77b1 100644 --- a/sources/pyside6/tests/QtCore/qobject_parent_test.py +++ b/sources/pyside6/tests/QtCore/qobject_parent_test.py @@ -105,10 +105,9 @@ class ParentCase(unittest.TestCase): for i, child in enumerate(children): self.assertEqual(child, parent.findChild(QObject, f'object{i}')) - def testFindChildOptions(self): parent = QObject() - child = QObject(parent) + child = QObject(parent) nested_child_name = 'nestedChild' nested_child = QObject(child) nested_child.setObjectName(nested_child_name) diff --git a/sources/pyside6/tests/QtCore/qresource_test.py b/sources/pyside6/tests/QtCore/qresource_test.py index 67285adcc..1cdd2c785 100644 --- a/sources/pyside6/tests/QtCore/qresource_test.py +++ b/sources/pyside6/tests/QtCore/qresource_test.py @@ -31,7 +31,7 @@ class ResourcesUsage(unittest.TestCase): if carriage_return != -1: orig.remove(carriage_return, 1) - f = QFile(':/quote.txt') #|QIODevice.Text + f = QFile(':/quote.txt') # |QIODevice.Text self.assertTrue(f.open(QIODevice.ReadOnly), f.errorString()) copy = f.readAll() f.close() diff --git a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py index 4178c7a10..82087ab9a 100644 --- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py +++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py @@ -60,7 +60,7 @@ class FeatureTest(unittest.TestCase): window.modal from __feature__ import snake_case, true_property - #PYSIDE-1548: Make sure that another import does not clear the features. + # PYSIDE-1548: Make sure that another import does not clear the features. import sys self.assertTrue(isinstance(QWidget.modal, property)) |