From 94c1b04583784654608d6634271bc6d2f7c1783e Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Sun, 1 May 2022 14:43:45 -0500 Subject: [PATCH] Enhancements and bug fixes for test suite. Add ability to start at given test. Fix bugs in 2 tests. --- test/ui.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/ui.py b/test/ui.py index 4f87748..1907a0c 100644 --- a/test/ui.py +++ b/test/ui.py @@ -112,6 +112,10 @@ parser.add_argument( help='print all available tests (widget names).', action='store_true' ) +parser.add_argument( + '--start', + help='test widget to start at.', +) args, unknown = parser.parse_known_args() if args.pyqt6: @@ -1602,7 +1606,7 @@ def test_indented_tree(widget, *_): tree.setColumnWidth(0, tree.columnWidth(0) * 2) tree.setColumnWidth(1, tree.columnWidth(1) * 2) - return tree3 + return tree def test_all_focus_tree(widget, *_): tree = QtWidgets.QTreeWidget(widget) @@ -1997,7 +2001,7 @@ def test_qt_colordialog(*_): def test_fontdialog(*_): initial = QtGui.QFont() - QtWidgets.QFontDialog.getColor(initial) + QtWidgets.QFontDialog.getFont(initial) return None, None, False, True @@ -2566,7 +2570,14 @@ def main(): gc.disable() os.environ['QT_SCALE_FACTOR'] = str(args.scale) if args.widget == 'all': - for widget in widget_names(): + widgets = widget_names() + if args.start != None: + try: + index = widgets.index(args.start) + widgets = widgets[index:] + except IndexError: + pass + for widget in widgets: test(args, sys.argv[:1] + unknown, widget) gc.collect() else: