1
""" Unittest for bug #576 """
2
""" http://bugs.openbossa.org/show_bug.cgi?id=576 """
4
from PySide import QtGui, QtCore
8
class Bug576(unittest.TestCase):
9
def onButtonDestroyed(self, button):
10
self._destroyed = True
12
def testWidgetParent(self):
13
self._destroyed = False
14
app = QtGui.QApplication(sys.argv)
17
b = QtGui.QPushButton("test")
18
b.destroyed[QtCore.QObject].connect(self.onButtonDestroyed)
19
self.assertEqual(sys.getrefcount(b), 2)
21
self.assertEqual(sys.getrefcount(b), 3)
23
self.assertEqual(sys.getrefcount(b), 3)
25
self.assertEqual(sys.getrefcount(b), 2)
27
self.assert_(self._destroyed)
30
if __name__ == '__main__':