summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-09 15:22:08 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-09-09 17:23:39 -0300
commitde31fbd3fe3bca3bbb3f794c2932ad60ae941e5f (patch)
treeb79805498276488d99c5ad92ca11a1c88482bb2c /tests
parent57dbef16c667e9ea5b687f3891967995af5318a7 (diff)
downloadpyside-de31fbd3fe3bca3bbb3f794c2932ad60ae941e5f.tar.gz
pyside-de31fbd3fe3bca3bbb3f794c2932ad60ae941e5f.tar.xz
pyside-de31fbd3fe3bca3bbb3f794c2932ad60ae941e5f.zip
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 f8fbee0..5b511cd 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 0000000..9fc9df5
--- /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()