PY-24942 Don't chain AND expressions in Simplify chained comparison

When the leftmost binary relationship expression of the two being
transformed belongs itself to the left operand of a nested logical AND.
Previously, we mistakenly tried to insert the containing logical AND
expression into the generated chained comparison when useRightChildOfLeft
parameter of the quickfix was false.
This commit is contained in:
Mikhail Golubev
2018-03-23 17:43:41 +03:00
parent aea4f34683
commit 36df2222b6
4 changed files with 15 additions and 16 deletions
@@ -301,6 +301,11 @@ public class PyQuickFixTest extends PyTestCase {
doInspectionTest(PyChainedComparisonsInspection.class, "Simplify chained comparison", true, true);
}
// PY-24942
public void testChainedComparison8() {
doInspectionTest(PyChainedComparisonsInspection.class, "Simplify chained comparison", true, true);
}
// PY-1362, PY-2585
public void testStatementEffect() {
doInspectionTest(PyStatementEffectInspection.class, PyBundle.message("QFIX.statement.effect"), true, true);