From 27de0f43b4d391b30b22c3cc36e3721bde23d8a4 Mon Sep 17 00:00:00 2001 From: dalthviz <16781833+dalthviz@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:45:12 -0500 Subject: [PATCH] Add test to ensure QToolBar passes isinstance check --- qtpy/tests/test_qtwidgets.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qtpy/tests/test_qtwidgets.py b/qtpy/tests/test_qtwidgets.py index f0997b11..f1c8e83d 100644 --- a/qtpy/tests/test_qtwidgets.py +++ b/qtpy/tests/test_qtwidgets.py @@ -164,6 +164,13 @@ def test_QToolBar_functions(qtbot): ) +def test_QToolBar_submenu_instance(qtbot): + """Test `QtWidgets.QToolBar` passes `isinstance` checks.""" + window = QtWidgets.QMainWindow() + new_toolbar = window.addToolBar("Toolbar title") + assert isinstance(new_toolbar, QtWidgets.QToolBar) + + @pytest.mark.skipif( PYQT5 and PYQT_VERSION.startswith("5.9"), reason="A specific setup with at least sip 4.9.9 is needed for PyQt5 5.9.*"