aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/wrong_return_test.py
blob: 1807e4a2307b942b2987fcca3a9dbb4153f9ac16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'''Test cases for Virtual functions with wrong return type'''

import unittest

from PySide import QtCore, QtGui

from helper import UsesQApplication

import warnings
warnings.simplefilter('error')


class MyWidget(QtGui.QWidget):
    def __init__(self, parent=None):
        super(MyWidget, self).__init__(parent)

    def sizeHint(self):
        pass

class testCase(UsesQApplication):

    def testVirtualReturn(self):
        w = MyWidget()
        self.assertRaises(RuntimeWarning, w.show)

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