blob: 8394f6e8d0d704ac332a60906e7d3c7791cca032 (
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
28
29
30
|
'''Test cases for Virtual functions with wrong return type'''
import unittest
import py3kcompat as py3k
from PySide import 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()
if py3k.IS_PY3K:
self.assertWarns(RuntimeWarning, w.show)
else:
self.assertRaises(RuntimeWarning, w.show)
if __name__ == '__main__':
unittest.main()
|