Added test for bug #428.
Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
a7d09741c2
commit
5944cc8d99
1 changed files with 13 additions and 0 deletions
|
|
@ -38,6 +38,19 @@ class InheritsCase(unittest.TestCase):
|
||||||
self.assert_(Dummy().inherits('QObject'))
|
self.assert_(Dummy().inherits('QObject'))
|
||||||
self.assert_(not Dummy().inherits('Parent'))
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue