aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-09 15:22:08 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:51 -0300
commit846759b324b147ce29f6390f110b0c136258df07 (patch)
treef4dc4b4cf66348408158da0824781dc173a8c58b /tests
parente92b60162069ba177d755dc045cd6233440dca2a (diff)
Created unit test for bug #1002.
Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_1002.py19
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index f8fbee02b..5b511cdfd 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -77,6 +77,7 @@ PYSIDE_TEST(bug_979.py)
PYSIDE_TEST(bug_988.py)
PYSIDE_TEST(bug_991.py)
PYSIDE_TEST(bug_998.py)
+PYSIDE_TEST(bug_1002.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(event_filter_test.py)
diff --git a/tests/QtGui/bug_1002.py b/tests/QtGui/bug_1002.py
new file mode 100644
index 000000000..9fc9df5cc
--- /dev/null
+++ b/tests/QtGui/bug_1002.py
@@ -0,0 +1,19 @@
+import unittest
+import sys
+from PySide.QtGui import QWidget, QPushButton
+
+from helper import UsesQApplication
+
+class TestBug1002 (UsesQApplication):
+ def testReturnWindow(self):
+ widget = QWidget()
+ button = QPushButton(widget)
+ self.assertEqual(sys.getrefcount(widget), 2)
+ window = button.window()
+ self.assertEqual(sys.getrefcount(widget), 3)
+ self.assertEqual(sys.getrefcount(window), 3)
+
+ del widget
+
+if __name__ == '__main__':
+ unittest.main()