diff options
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r-- | sources/pyside2/tests/QtWidgets/qstyle_test.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/pyside2/tests/QtWidgets/qstyle_test.py b/sources/pyside2/tests/QtWidgets/qstyle_test.py index eb2a73d29..1dcce2737 100644 --- a/sources/pyside2/tests/QtWidgets/qstyle_test.py +++ b/sources/pyside2/tests/QtWidgets/qstyle_test.py @@ -26,6 +26,7 @@ ## ############################################################################# +import sys import unittest from helper import UsesQApplication @@ -78,6 +79,13 @@ class SetStyleTest(UsesQApplication): QApplication.instance().processEvents() self.assertTrue(proxyStyle.polished > 0) + def testSetStyleOwnership(self): + style = QStyleFactory.create(QStyleFactory.keys()[0]) + self.assertEqual(sys.getrefcount(style), 2) + QApplication.instance().setStyle(style) + self.assertEqual(sys.getrefcount(style), 3) + + if __name__ == '__main__': unittest.main() |