aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-10-29 10:57:35 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-10-29 15:04:46 -0300
commit5944cc8d99d0c72cd87aa572224d3492e05c10eb (patch)
treedf50bd660c9f77d86b43acc12ae51e5dd8d3cde1 /tests/QtCore
parenta7d09741c2f4a094867a9729bbba82472aed0db1 (diff)
Added test for bug #428.
Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-rw-r--r--tests/QtCore/qobject_inherits_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/QtCore/qobject_inherits_test.py b/tests/QtCore/qobject_inherits_test.py
index 9e02b0a46..fce383aae 100644
--- a/tests/QtCore/qobject_inherits_test.py
+++ b/tests/QtCore/qobject_inherits_test.py
@@ -38,6 +38,19 @@ class InheritsCase(unittest.TestCase):
self.assert_(Dummy().inherits('QObject'))
self.assert_(not Dummy().inherits('Parent'))
+ def testSetAttributeBeforeCallingInitOnQObjectDerived(self):
+ '''Test for bug #428.'''
+ class DerivedObject(QObject):
+ def __init__(self):
+ self.member = 'member'
+ QObject.__init__(self)
+ obj0 = DerivedObject()
+ # The second instantiation of DerivedObject will generate an exception
+ # that will not come to surface immediately.
+ obj1 = DerivedObject()
+ # The mere calling of the object method causes
+ # the exception to "reach the surface".
+ obj1.objectName()
if __name__ == '__main__':
unittest.main()