blob: e346a34686cfaed035a69120a604a4711f503d5b [file] [log] [blame]
Tor Norbye3a2425a2013-11-04 10:16:08 -08001class Z(object):
2 def method(self):
3 pass
4
5class A(object):
6 def method(self, *args, **kwargs):
7 Z.method(<weak_warning descr="Passing inspections.PyCallByClassInspection.test.A instead of inspections.PyCallByClassInspection.test.Z. Is this intentional?">self</weak_warning>) # passing wrong instance
8 Z.method(<weak_warning descr="An instance of inspections.PyCallByClassInspection.test.Z expected, not the class itself">Z</weak_warning>) # passing class instead of instance
9 Z.method(<weak_warning descr="Passing inspections.PyCallByClassInspection.test.A instead of inspections.PyCallByClassInspection.test.Z. Is this intentional?"><weak_warning descr="An instance of inspections.PyCallByClassInspection.test.Z expected, not the class itself">A</weak_warning></weak_warning>) # passing class instead of instance AND wrong class
10 Z.method(Z()) #pass
11
12 def __init__(self):
13 pass
14
15class B(A):
16 def __init__(self):
17 A.__init__(self) # pass
18
19A.method(<weak_warning descr="Passing inspections.PyCallByClassInspection.test.B instead of inspections.PyCallByClassInspection.test.A. Is this intentional?">B()</weak_warning>)