summaryrefslogtreecommitdiff
path: root/python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java')
-rw-r--r--python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java b/python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java
index 109a1bddd19b..e64f02ad16c3 100644
--- a/python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java
+++ b/python/testSrc/com/jetbrains/python/PythonKeywordCompletionTest.java
@@ -199,6 +199,17 @@ public class PythonKeywordCompletionTest extends PyTestCase {
assertContainsElements(doTestByText("for x i<caret>n y:\n pass]"), "in");
}
+ // PY-11375
+ public void testYieldExpression() {
+ assertContainsElements(doTestByText("def gen(): x = <caret>"), "yield");
+ assertDoesntContain(doTestByText("def gen(): x = 1 + <caret>"), "yield");
+ assertContainsElements(doTestByText("def gen(): x = 1 + (<caret>"), "yield");
+ assertContainsElements(doTestByText("def gen(): x **= <caret>"), "yield");
+ assertDoesntContain(doTestByText("def gen(): func(<caret>)"), "yield");
+ assertContainsElements(doTestByText("def gen(): func((<caret>"), "yield");
+ assertDoesntContain(doTestByText("def gen(): x = y<caret> = 42"), "yield");
+ }
+
public void testExceptAfterElse() {
assertDoesntContain(doTestByText("try:\n" +
" pass\n" +