| Tor Norbye | 3a2425a | 2013-11-04 10:16:08 -0800 | [diff] [blame^] | 1 | class Z(object): |
| 2 | def method(self): |
| 3 | pass |
| 4 | |
| 5 | class 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 | |
| 15 | class B(A): |
| 16 | def __init__(self): |
| 17 | A.__init__(self) # pass |
| 18 | |
| 19 | A.method(<weak_warning descr="Passing inspections.PyCallByClassInspection.test.B instead of inspections.PyCallByClassInspection.test.A. Is this intentional?">B()</weak_warning>) |