mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-85027 Add regression tests
GitOrigin-RevId: 14606341ba91426d27c8a82c64927636830c8b54
This commit is contained in:
committed by
intellij-monorepo-bot
parent
75d5a08801
commit
57405bf4d6
@@ -0,0 +1,11 @@
|
||||
from typing import Callable
|
||||
|
||||
|
||||
def outer_decorator[**P, T](f: Callable[P, T]) -> Callable[P, T]:
|
||||
return f
|
||||
|
||||
|
||||
class NonWorkingClass:
|
||||
@outer_decorator
|
||||
def add_two(self, x: float, y: float) -> float:
|
||||
return x + y
|
||||
@@ -6808,6 +6808,34 @@ public class PyTypingTest extends PyTestCase {
|
||||
""");
|
||||
}
|
||||
|
||||
// PY-85027
|
||||
public void testImportedBoundMethodDecoratedWithParamSpec() {
|
||||
doMultiFileStubAwareTest("(x: float, y: float) -> float", """
|
||||
from mod import NonWorkingClass
|
||||
|
||||
expr = NonWorkingClass().add_two
|
||||
""");
|
||||
}
|
||||
|
||||
// PY-85027
|
||||
public void testBoundMethodDecoratedWithParamSpec() {
|
||||
doTest("(x: float, y: float) -> float", """
|
||||
from typing import Callable
|
||||
|
||||
def outer_decorator[**P, T](f: Callable[P, T]) -> Callable[P, T]:
|
||||
return f
|
||||
|
||||
|
||||
class NonWorkingClass:
|
||||
@outer_decorator
|
||||
def add_two(self, x: float, y: float) -> float:
|
||||
return x + y
|
||||
|
||||
|
||||
expr = NonWorkingClass().add_two
|
||||
""");
|
||||
}
|
||||
|
||||
private void doTestNoInjectedText(@NotNull String text) {
|
||||
myFixture.configureByText(PythonFileType.INSTANCE, text);
|
||||
final InjectedLanguageManager languageManager = InjectedLanguageManager.getInstance(myFixture.getProject());
|
||||
|
||||
@@ -644,4 +644,22 @@ public class Py3ArgumentListInspectionTest extends PyInspectionTestCase {
|
||||
public void testImportedDecoratedFunctionWithParamSpec() {
|
||||
doMultiFileTest();
|
||||
}
|
||||
|
||||
// PY-85027
|
||||
public void testBoundMethodDecoratedWithParamSpec() {
|
||||
doTestByText("""
|
||||
from typing import Callable
|
||||
|
||||
def outer_decorator[**P, T](f: Callable[P, T]) -> Callable[P, T]:
|
||||
return f
|
||||
|
||||
class NonWorkingClass:
|
||||
@outer_decorator
|
||||
def add_two(self, x: float, y: float) -> float:
|
||||
return x + y
|
||||
|
||||
|
||||
NonWorkingClass().add_two(<warning descr="Parameter 'x' unfilled"><warning descr="Parameter 'y' unfilled">)</warning></warning>
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user