diff --git a/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java b/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java index 0dbd8765dd47..ee5b19984343 100644 --- a/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java +++ b/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java @@ -124,13 +124,7 @@ public class PySubstitutionChunkReference extends PsiReferenceBasefst)s" % {1: "3"}) \ No newline at end of file diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/formatStringDictLiteralArgumentWithReferenceExprKeys.py b/python/testData/inspections/PyUnresolvedReferencesInspection/formatStringDictLiteralArgumentWithReferenceExprKeys.py new file mode 100644 index 000000000000..82c1ed167b4b --- /dev/null +++ b/python/testData/inspections/PyUnresolvedReferencesInspection/formatStringDictLiteralArgumentWithReferenceExprKeys.py @@ -0,0 +1,3 @@ +f = "fst" +s = "snd" +v = "first {fst}, second {snd}".format(**{s: 221, f: 10}) \ No newline at end of file diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/percentStringDictLiteralArgumentWithReferenceExprKeys.py b/python/testData/inspections/PyUnresolvedReferencesInspection/percentStringDictLiteralArgumentWithReferenceExprKeys.py new file mode 100644 index 000000000000..b1c1a1b61319 --- /dev/null +++ b/python/testData/inspections/PyUnresolvedReferencesInspection/percentStringDictLiteralArgumentWithReferenceExprKeys.py @@ -0,0 +1,3 @@ +f = "fst" +s = "snd" +print ("first is %(fst)s, second is %(snd)s" % {s: "3", f: "1"}) \ No newline at end of file diff --git a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java index 5eb1fe6ca0be..9c28683a89c0 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java @@ -587,6 +587,22 @@ public class PyUnresolvedReferencesInspectionTest extends PyInspectionTestCase { doTest(); } + // PY-2748 + public void testFormatStringDictLiteralArgumentWithReferenceExprKeys() { + doTest(); + } + + // PY-2748 + public void testPercentStringDictLiteralArgumentWithReferenceExprKeys() { + doTest(); + } + + // PY-2748 + public void testFormatStringDictLiteralArgumentWithNumericExprKeys() { + doTest(); + } + + // PY-18254 public void testVarargsAnnotatedWithFunctionComment() { doTest();