aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtUiTools/bug_909.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2025-07-28 09:52:10 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2025-10-15 11:59:13 +0200
commit08bc8b8d6b6020e5fd307fd1a4a14baf908db6cb (patch)
treeeebe966df40630061840f339d055846491f5aee9 /sources/pyside6/tests/QtUiTools/bug_909.py
parent3369a18ff24046e21b6e505ab5399f2d69101a8d (diff)
Fix reference count tests (2) to pass in Python 3.14 (obscure cases)
As of 3.14, the interpreter will sometimes just borrow references and newly created objects may have different initial reference counts. Pick-to: 6.10 6.8 Task-number: PYSIDE-3147 Change-Id: I845460202abb95715ebf395b378b81b7790660bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/tests/QtUiTools/bug_909.py')
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_909.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/pyside6/tests/QtUiTools/bug_909.py b/sources/pyside6/tests/QtUiTools/bug_909.py
index e1a1df8f6..1be2936a2 100644
--- a/sources/pyside6/tests/QtUiTools/bug_909.py
+++ b/sources/pyside6/tests/QtUiTools/bug_909.py
@@ -26,7 +26,8 @@ class TestDestruction(UsesQApplication):
fileName = QFile(file)
loader = QUiLoader()
main_win = loader.load(fileName)
- self.assertEqual(sys.getrefcount(main_win), 2)
+ expected_ref_count = 1 if sys.version_info >= (3, 14) else 2
+ self.assertEqual(sys.getrefcount(main_win), expected_ref_count)
fileName.close()
tw = QTabWidget(main_win)