Created unit test for bug #1002.

Reviewer: Hugo Parente <hugo.lima@openbossa.org>
          Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
Renato Filho 2011-09-09 15:22:08 -03:00 • committed by Hugo Parente Lima
commit 846759b324
2 changed files with 20 additions and 0 deletions

19
tests/QtGui/bug_1002.py Normal file
View file

@ -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()