Add an option to ignore unused variables starting with '_' (PY-27435)

This commit is contained in:
Semyon Proshev
2018-04-13 19:23:01 +03:00
parent 3eecbdccd4
commit 4250af811d
5 changed files with 24 additions and 8 deletions
@@ -87,6 +87,7 @@ public class PyUnusedLocalInspectionTest extends PyInspectionTestCase {
}
// PY-3996
// PY-27435
public void testUnderscorePrefixed() {
doTest();
}
@@ -101,6 +102,13 @@ public class PyUnusedLocalInspectionTest extends PyInspectionTestCase {
runWithLanguageLevel(LanguageLevel.PYTHON37, this::doTest);
}
// PY-27435
public void testVariableStartingWithUnderscore() {
final PyUnusedLocalInspection inspection = new PyUnusedLocalInspection();
inspection.ignoreVariablesStartingWithUnderscore = false;
doTest(inspection);
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {