import unittest
import os
from helper import UsesQApplication

from PySide import QtCore, QtGui
from PySide.QtUiTools import QUiLoader

class BugTest(UsesQApplication):
    def testCase(self):
        w = QtGui.QWidget()
        loader = QUiLoader()

        filePath = os.path.join(os.path.dirname(__file__), 'test.ui')
        result = loader.load(filePath, w)
        self.assertEqual(type(result.child_object), QtGui.QFrame)

if __name__ == '__main__':
    unittest.main()


import unittest
import os
from helper import UsesQApplication

from PySide import QtCore, QtGui
from PySide.QtUiTools import QUiLoader

class BugTest(UsesQApplication):
    def testCase(self):
        w = QtGui.QWidget()
        loader = QUiLoader()

        filePath = os.path.join(os.path.dirname(__file__), 'test.ui')
        result = loader.load(filePath, w)
        self.assert_(isinstance(result.child_object, QtGui.QFrame))

if __name__ == '__main__':
    unittest.main()


Replace type() comparison with isinstance.
Replace type() comparison with isinstance.

type() comparison won't work due to weakproxy.

Reviewer: Luciano Wolf <c353ae890f0e6de8473e43011f009ccd38a3c452@openbossa.org>
Reviewer: Hugo Lima <e250cbdf6b5a11059e9d944a6e5e9282be80d14c@openbossa.org>
Reviewer: Renato Filho <16af9705e5a16d85aed275f2f9e8171326ec17f6@openbossa.org>
