From 5e20034a0afd3528e2b6555f8fda7b92ccd65b68 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 29 Aug 2017 18:09:49 +0300 Subject: [PATCH] PY-25794 Test for stub->AST switch in PyProtectedMembersInspection --- .../PyProtectedMemberInspection/ClassInAnotherModule/a.py | 8 ++++++++ .../ClassInAnotherModule/m1.py | 6 ++++++ .../inspections/PyProtectedMemberInspectionTest.java | 4 ++++ 3 files changed, 18 insertions(+) create mode 100644 python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/a.py create mode 100644 python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/m1.py diff --git a/python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/a.py b/python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/a.py new file mode 100644 index 000000000000..9063858e6dd8 --- /dev/null +++ b/python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/a.py @@ -0,0 +1,8 @@ +from m1 import A + + +def f(): + a = A() + a._foo() + return a._x + diff --git a/python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/m1.py b/python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/m1.py new file mode 100644 index 000000000000..bdb27d88a959 --- /dev/null +++ b/python/testData/inspections/PyProtectedMemberInspection/ClassInAnotherModule/m1.py @@ -0,0 +1,6 @@ +class A: + def __init__(self): + self._x = 1 + + def _foo(self): + pass diff --git a/python/testSrc/com/jetbrains/python/inspections/PyProtectedMemberInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyProtectedMemberInspectionTest.java index e25abcb647b2..b92beb696623 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyProtectedMemberInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyProtectedMemberInspectionTest.java @@ -80,6 +80,10 @@ public class PyProtectedMemberInspectionTest extends PyInspectionTestCase { doMultiFileTest(); } + public void testClassInAnotherModule() { + doMultiFileTest(); + } + @NotNull @Override protected Class getInspectionClass() {