mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-20057 Fix a few tests broken due to changes in PyGenericType
This commit is contained in:
@@ -26,7 +26,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
@@ -84,7 +83,7 @@ public class PyGenericType implements PyType, PyInstantiableType<PyGenericType>
|
||||
return false;
|
||||
}
|
||||
final PyGenericType type = (PyGenericType)o;
|
||||
return myName.equals(type.myName) && Objects.equals(myBound, type.getBound()) && myIsDefinition == type.isDefinition();
|
||||
return myName.equals(type.myName) && myIsDefinition == type.isDefinition();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,7 @@ def test():
|
||||
for item in func(<warning descr="Expected type '(Any) -> str', got '(x: Any) -> int' instead">f</warning>, []):
|
||||
pass
|
||||
|
||||
for item in func(<warning descr="Expected type '(Any) -> str', got 'int' instead">int</warning>, []):
|
||||
for item in func(<warning descr="Expected type '(Any) -> str', got 'Type[int]' instead">int</warning>, []):
|
||||
pass
|
||||
|
||||
for item in func(<warning descr="Expected type '(Any) -> str', got '(x: Any) -> int' instead">lambda x: int(x)</warning>, []):
|
||||
|
||||
@@ -23,7 +23,7 @@ for x in C1:
|
||||
pass
|
||||
|
||||
|
||||
for y in <warning descr="Expected 'collections.Iterable', got 'C2' instead">C2</warning>:
|
||||
for y in <warning descr="Expected 'collections.Iterable', got 'Type[C2]' instead">C2</warning>:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jetbrains.python.psi.PyUtil.as;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
@@ -139,7 +137,7 @@ public class PyTypeParserTest extends PyTestCase {
|
||||
final PyType type = PyTypeParser.getTypeByName(myFixture.getFile(), "T");
|
||||
assertNotNull(type);
|
||||
assertInstanceOf(type, PyGenericType.class);
|
||||
assertEquals("TypeVar('T')", type.getName());
|
||||
assertEquals("T", type.getName());
|
||||
}
|
||||
|
||||
// PY-4223
|
||||
@@ -251,7 +249,7 @@ public class PyTypeParserTest extends PyTestCase {
|
||||
assertEquals("int", type0.getName());
|
||||
final PyType type1 = parameterTypes.get(1).getType(context);
|
||||
assertNotNull(type1);
|
||||
assertEquals("TypeVar('T')", type1.getName());
|
||||
assertEquals("T", type1.getName());
|
||||
}
|
||||
|
||||
public void testCallableWithoutArgs() {
|
||||
|
||||
Reference in New Issue
Block a user