diff options
| author | Christian Tismer <tismer@stackless.com> | 2023-12-23 13:00:46 +0100 |
|---|---|---|
| committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2024-11-25 22:35:34 +0000 |
| commit | 5d0b4fc9be0c3f413246c12ca43b39c5ef5ab796 (patch) | |
| tree | a56b0abc91054191210f3b06d1885c41646d070d | |
| parent | 8393e4a8d07656b92b7c3000d591a98a7c6634ab (diff) | |
PyPySide: Fix a garbage collector problem in a new test
Change-Id: I82f38a1ec06b922e8554d7aac8969cf945e338ba
Task-number: PYSIDE-535
Pick-to: 6.8 6.7 6.5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| -rw-r--r-- | sources/pyside6/tests/QtCore/signal_sender.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sources/pyside6/tests/QtCore/signal_sender.py b/sources/pyside6/tests/QtCore/signal_sender.py index 464c50e3d..bcefe835e 100644 --- a/sources/pyside6/tests/QtCore/signal_sender.py +++ b/sources/pyside6/tests/QtCore/signal_sender.py @@ -2,18 +2,19 @@ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 from __future__ import annotations +import gc import os import sys import unittest from pathlib import Path sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) -from init_paths import init_test_paths +from init_paths import init_test_paths # noqa: E402 init_test_paths(False) -from helper.usesqapplication import UsesQApplication +from helper.usesqapplication import UsesQApplication # noqa: E402 -from PySide6.QtCore import (QCoreApplication, QObject, QStringListModel, +from PySide6.QtCore import (QCoreApplication, QObject, QStringListModel, # noqa: E402 QTimer, Signal, Slot, Qt) @@ -83,6 +84,9 @@ class TestConstructorConnection(UsesQApplication): dataChanged=changed_handler) model.setData(model.index(0, 0), "bla", Qt.EditRole) del model + # PYSIDE-535: Need to collect garbage twice in PyPy to trigger deletion + gc.collect() + gc.collect() self.assertTrue(was_changed) self.assertTrue(was_destroyed) |
