diff options
Diffstat (limited to 'sources/pyside6/tests/signals/bug_79.py')
-rw-r--r-- | sources/pyside6/tests/signals/bug_79.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/pyside6/tests/signals/bug_79.py b/sources/pyside6/tests/signals/bug_79.py index 54bd1f076..77ac621d5 100644 --- a/sources/pyside6/tests/signals/bug_79.py +++ b/sources/pyside6/tests/signals/bug_79.py @@ -30,7 +30,7 @@ class ConnectTest(unittest.TestCase): def testNoLeaks_ConnectAndDisconnect(self): self._called = None - app = QApplication([]) + app = QApplication([]) # noqa: F841 o = QTreeView() o.setModel(QStandardItemModel()) o.selectionModel().destroyed.connect(self.callback) @@ -38,6 +38,11 @@ class ConnectTest(unittest.TestCase): gc.collect() # if this is no debug build, then we check at least that # we do not crash any longer. + for idx in range(200): + # PYSIDE-2230: Warm-up is necessary before measuring, because + # the code changes the constant parts after some time. + o.selectionModel().destroyed.connect(self.callback) + o.selectionModel().destroyed.disconnect(self.callback) if not skiptest: total = gettotalrefcount() for idx in range(1000): |