PY-24834 Disable tests requiring weak union semantics

GitOrigin-RevId: 7789fc014c8c413c44cba23865737dbba3860325
This commit is contained in:
Mikhail Golubev
2025-08-12 17:19:34 +00:00
committed by intellij-monorepo-bot
parent 523f0f2e2c
commit f8e21af84e
5 changed files with 9 additions and 7 deletions
@@ -70,6 +70,7 @@ public class PyBinaryExpressionImpl extends PyElementImpl implements PyBinaryExp
PyType callResultType = PyCallExpressionHelper.getCallType(this, context, key);
if (callResultType != null) {
boolean bothOperandsAreKnown = operandIsKnown(getLeftExpression(), context) && operandIsKnown(getRightExpression(), context);
// TODO requires weak union. See PyTypeCheckerInspectionTest#testBinaryExpressionWithUnknownOperand
return bothOperandsAreKnown ? callResultType : PyUnionType.createWeakType(callResultType);
}
if (referencedName != null && PyNames.COMPARISON_OPERATORS.contains(referencedName)) {
@@ -562,6 +562,7 @@ private fun ClarifiedResolveResult.clarifyConstructorCallType(callSite: PyCallSi
return initOrNewCallType
}
if (initOrNewCallType == null) {
// TODO requires weak union. See PyUnresolvedReferencesInspectionTest.testCustomNewReturnInAnotherModule
return PyUnionType.createWeakType(PyClassTypeImpl(receiverClass, false))
}
@@ -1,4 +1,4 @@
from b import C
c = C()
c.<weak_warning descr="Some members of 'Union[C, Any]' don't have attribute 'foo'">foo</weak_warning>()
c.foo()
@@ -429,9 +429,9 @@ public class PyTypeCheckerInspectionTest extends PyInspectionTestCase {
}
// PY-9662
public void testBinaryExpressionWithUnknownOperand() {
runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
}
//public void testBinaryExpressionWithUnknownOperand() {
// runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest);
//}
// PY-16066
public void testBasestringMatchesType() {
@@ -293,9 +293,9 @@ public class PyUnresolvedReferencesInspectionTest extends PyInspectionTestCase {
}
// PY-10893
public void testCustomNewReturnInAnotherModule() {
doMultiFileTest("a.py");
}
//public void testCustomNewReturnInAnotherModule() {
// doMultiFileTest("a.py");
//}
public void testBytesIOMethods() {
doTest();