PY-25794 Test for stub->AST switch in PyProtectedMembersInspection

This commit is contained in:
Andrey Vlasovskikh
2017-08-29 21:39:05 +03:00
parent ed9732aa82
commit 5e20034a0a
3 changed files with 18 additions and 0 deletions
@@ -0,0 +1,8 @@
from m1 import A
def f():
a = A()
<weak_warning descr="Access to a protected member _foo of a class">a._foo</weak_warning>()
return <weak_warning descr="Access to a protected member _x of a class">a._x</weak_warning>
@@ -0,0 +1,6 @@
class A:
def __init__(self):
self._x = 1
def _foo(self):
pass
@@ -80,6 +80,10 @@ public class PyProtectedMemberInspectionTest extends PyInspectionTestCase {
doMultiFileTest();
}
public void testClassInAnotherModule() {
doMultiFileTest();
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {