mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Test for missed super.__init__ call with positional-only parameters (PEP 570) (PY-35512)
GitOrigin-RevId: cf61e7c851f08223582caa58c58e4868b5cd7e35
This commit is contained in:
committed by
intellij-monorepo-bot
parent
221ecaea49
commit
49bbf98c53
@@ -0,0 +1,7 @@
|
||||
class A:
|
||||
def __init__(self, a, /, b, *args, c, **kwargs):
|
||||
pass
|
||||
|
||||
class B(A):
|
||||
def <warning descr="Call to __init__ of super class is missed">__in<caret>it__</warning>(self):
|
||||
pass
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A:
|
||||
def __init__(self, a, /, b, *args, c, **kwargs):
|
||||
pass
|
||||
|
||||
class B(A):
|
||||
def __init__(self, a, /, b, *args, c, **kwargs):
|
||||
super().__init__(a, b, *args, c=c, **kwargs)
|
||||
@@ -19,8 +19,9 @@ import com.intellij.testFramework.TestDataPath;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.PyQuickFixTestCase;
|
||||
import com.jetbrains.python.inspections.PyMissingConstructorInspection;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
|
||||
@TestDataPath("$CONTENT_ROOT/../testData//quickFixes/AddCallSuperQuickFixTest/")
|
||||
@TestDataPath("$CONTENT_ROOT/../testData/quickFixes/PyAddCallSuperQuickFixTest/")
|
||||
public class PyAddCallSuperQuickFixTest extends PyQuickFixTestCase {
|
||||
|
||||
public void testOldStyle() {
|
||||
@@ -34,4 +35,9 @@ public class PyAddCallSuperQuickFixTest extends PyQuickFixTestCase {
|
||||
public void testKwargs() {
|
||||
doQuickFixTest(PyMissingConstructorInspection.class, PyBundle.message("QFIX.add.super"));
|
||||
}
|
||||
|
||||
// PY-35512
|
||||
public void testPositionalOnlyParameters() {
|
||||
doQuickFixTest(PyMissingConstructorInspection.class, PyBundle.message("QFIX.add.super"), LanguageLevel.PYTHON38);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user