mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Special case completion for __prepare__ (PY-28154)
Apply inspection settings and decorate with `@classmethod`
This commit is contained in:
@@ -7,6 +7,7 @@ import com.intellij.testFramework.LightProjectDescriptor;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import com.jetbrains.python.fixtures.PyTestCase;
|
||||
import com.jetbrains.python.inspections.PyMethodParametersInspection;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -175,7 +176,30 @@ public class Py3CompletionTest extends PyTestCase {
|
||||
|
||||
// PY-17828
|
||||
public void testDunderPrepare() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON34, this::doTest);
|
||||
runWithLanguageLevel(
|
||||
LanguageLevel.PYTHON34,
|
||||
() -> {
|
||||
final String testName = getTestName(true);
|
||||
myFixture.configureByFile(testName + ".py");
|
||||
myFixture.completeBasicAllCarets(null);
|
||||
myFixture.checkResultByFile(testName + ".after.py");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// PY-17828
|
||||
public void testDunderPrepareHonourInspectionSettings() {
|
||||
runWithLanguageLevel(
|
||||
LanguageLevel.PYTHON34,
|
||||
() -> {
|
||||
myFixture.enableInspections(PyMethodParametersInspection.class);
|
||||
|
||||
final String testName = getTestName(true);
|
||||
myFixture.configureByFile(testName + ".py");
|
||||
myFixture.completeBasicAllCarets(null);
|
||||
myFixture.checkResultByFile(testName + ".after.py");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// PY-20279
|
||||
|
||||
Reference in New Issue
Block a user