aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/tools/list-class-hierarchy.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-12-09 11:23:48 +0100
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2024-12-12 09:07:04 +0100
commit86bea038625367f5e4f0898c3312ecb7ded1ada4 (patch)
treecf8ca4da1b3f3ff193e153b082d3214a1ebdfa08 /sources/pyside6/tests/tools/list-class-hierarchy.py
parent3496f7bc309a139a01d0a423a2bf7157dfd9478e (diff)
tests: handle unused imports and fix type issues
Many modules were imported but unused in our tests. Additionally, some type hint issues were solved. Pick-to: 6.8 Change-Id: Ic2368690e9a6ce0fffea812206185aa4f3dc3c58 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/tests/tools/list-class-hierarchy.py')
-rw-r--r--sources/pyside6/tests/tools/list-class-hierarchy.py32
1 files changed, 15 insertions, 17 deletions
diff --git a/sources/pyside6/tests/tools/list-class-hierarchy.py b/sources/pyside6/tests/tools/list-class-hierarchy.py
index 2a3824f23..15c7ed181 100644
--- a/sources/pyside6/tests/tools/list-class-hierarchy.py
+++ b/sources/pyside6/tests/tools/list-class-hierarchy.py
@@ -13,8 +13,6 @@ from __future__ import annotations
#
# meld pyside.list pyqt5.list
-import sys
-import pdb
from inspect import isclass
ignore = ["staticMetaObject",
@@ -48,26 +46,26 @@ def recurse_into(el, obj):
if __name__ == '__main__':
- modules = [ 'QtCore',
- 'QtGui',
- 'QtHelp',
+ modules = ['QtCore',
+ 'QtGui',
+ 'QtHelp',
#'QtMultimedia',
- 'QtNetwork',
+ 'QtNetwork',
#'QtOpenGL',
- 'QtScript',
- 'QtScriptTools',
- 'QtSql',
- 'QtSvg',
- 'QtTest',
+ 'QtScript',
+ 'QtScriptTools',
+ 'QtSql',
+ 'QtSvg',
+ 'QtTest',
#'QtUiTools',
- 'QtXml',
- 'QtXmlPatterns' ]
+ 'QtXml',
+ 'QtXmlPatterns']
libraries = ["PySide6", "PyQt5"]
librarySymbols = {}
- for l in libraries:
+ for lib in libraries:
dictionary = []
- if l == "PyQt5":
+ if lib == "PyQt5":
import sip
sip.setapi('QDate', 2)
sip.setapi('QDateTime', 2)
@@ -78,9 +76,9 @@ if __name__ == '__main__':
sip.setapi('QVariant', 2)
for m in modules:
- exec(f"from {l} import {m}", globals(), locals())
+ exec(f"from {lib} import {m}", globals(), locals())
dictionary += recurse_into(m, eval(m))
- librarySymbols[l] = dictionary
+ librarySymbols[lib] = dictionary
print("PyQt5: ", len(librarySymbols["PyQt5"]), " PySide6: ", len(librarySymbols["PySide6"]))