PY-20770 Fixed: Support Python 3.6 asynchronous generators and comprehensions

Update CompatibilityVisitor to highlight "async" inside comprehensions and generator expressions in Pythons < 3.6
This commit is contained in:
Semyon Proshev
2016-09-20 21:56:27 +03:00
parent e23de0ceb6
commit 464ade6789
6 changed files with 80 additions and 2 deletions

View File

@@ -310,6 +310,16 @@ public class PythonHighlightingTest extends PyTestCase {
doTest();
}
// PY-20770
public void testAsyncComprehensionsPy35() {
doTest(LanguageLevel.PYTHON35, true, false);
}
// PY-20770
public void testAsyncComprehensionsPy36() {
doTest(LanguageLevel.PYTHON36, true, false);
}
// PY-20775
public void testFStringMissingRightBrace() {
runWithLanguageLevel(LanguageLevel.PYTHON36, () -> doTest(true, false));
@@ -329,12 +339,12 @@ public class PythonHighlightingTest extends PyTestCase {
public void testFStringHashSigns() {
runWithLanguageLevel(LanguageLevel.PYTHON36, () -> doTest(true, false));
}
// PY-20844
public void testFStringBackslashes() {
runWithLanguageLevel(LanguageLevel.PYTHON36, () -> doTest(true, false));
}
// ---
private void doTest(final LanguageLevel languageLevel, final boolean checkWarnings, final boolean checkInfos) {
PythonLanguageLevelPusher.setForcedLanguageLevel(myFixture.getProject(), languageLevel);