Update skeletons for min function to fit updated type processing of positional and keyword arguments

This commit is contained in:
Semyon Proshev
2016-11-29 20:32:25 +03:00
parent 4e8b052d74
commit c60419eb7e
4 changed files with 12 additions and 2 deletions
@@ -213,7 +213,7 @@ def min(*args, key=None, default=None):
"""Return the smallest item in an iterable or the smallest of two or more
arguments.
:type args: tuple[T]
:type args: T
:rtype: T
"""
pass
+1 -1
View File
@@ -225,7 +225,7 @@ def min(*args, key=None, default=None):
"""Return the smallest item in an iterable or the smallest of two or more
arguments.
:type args: tuple[T]
:type args: T
:rtype: T
"""
pass
@@ -465,6 +465,11 @@ public class Py3TypeTest extends PyTestCase {
"expr = input()");
}
public void testMinResult() {
doTest("int",
"expr = min(1, 2, 3)");
}
private void doTest(final String expectedType, final String text) {
myFixture.configureByText(PythonFileType.INSTANCE, text);
final PyExpression expr = myFixture.findElementByText("expr", PyExpression.class);
@@ -1514,6 +1514,11 @@ public class PyTypeTest extends PyTestCase {
" expr = things if things else []");
}
public void testMinResult() {
doTest("int",
"expr = min(1, 2, 3)");
}
private static List<TypeEvalContext> getTypeEvalContexts(@NotNull PyExpression element) {
return ImmutableList.of(TypeEvalContext.codeAnalysis(element.getProject(), element.getContainingFile()).withTracing(),
TypeEvalContext.userInitiated(element.getProject(), element.getContainingFile()).withTracing());