diff --git a/python/src/com/jetbrains/python/PyBundle.properties b/python/src/com/jetbrains/python/PyBundle.properties index b2de5b9433e4..eea21e952154 100644 --- a/python/src/com/jetbrains/python/PyBundle.properties +++ b/python/src/com/jetbrains/python/PyBundle.properties @@ -382,7 +382,7 @@ INSP.first.arg.$0.assigned=Method''s parameter ''{0}'' reassigned # PyStringFormatInspection INSP.NAME.str.format=Errors in string formatting operations INSP.format.requires.no.mapping=Format doesn't require a mapping -INSP.key.$0.has.no.arg=Key ''{0}'' has no following argument +INSP.key.$0.has.no.arg=Key ''{0}'' has no corresponding argument INSP.unexpected.type.$0=Unexpected type {0} INSP.too.few.keys=Too few mapping keys INSP.no.format.specifier.char=Format specifier character missing diff --git a/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java b/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java index df0c82b7dbd7..c573bc2d6249 100644 --- a/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java +++ b/python/src/com/jetbrains/python/codeInsight/PySubstitutionChunkReference.java @@ -71,7 +71,7 @@ public class PySubstitutionChunkReference extends PsiReferenceBase resolvedRef; try { - final Integer index = Integer.getInteger(key); + final Integer index = Integer.parseInt(key); resolvedRef = getElementFromDictLiteral((PyDictLiteralExpression)returnValueExpr, index, resolveContext); } catch (NumberFormatException e) { diff --git a/python/testSrc/com/jetbrains/python/PyResolveTest.java b/python/testSrc/com/jetbrains/python/PyResolveTest.java index 0cbf3392e7fd..fa80b9e8e625 100644 --- a/python/testSrc/com/jetbrains/python/PyResolveTest.java +++ b/python/testSrc/com/jetbrains/python/PyResolveTest.java @@ -681,7 +681,7 @@ public class PyResolveTest extends PyResolveTestCase { PsiElement target = resolve(); assertTrue(target instanceof PyNumericLiteralExpression); assertNotNull(((PyNumericLiteralExpression)target).getLongValue()); - assertTrue(4181 == ((PyNumericLiteralExpression)target).getLongValue()); + assertTrue(((PyNumericLiteralExpression)target).getLongValue() == 4181); } public void testPercentStringKeyWordArgWithParentheses() { diff --git a/python/testSrc/com/jetbrains/python/inspections/Py3StringFormatInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/Py3StringFormatInspectionTest.java index ef2b4ebabd64..cdf4a5586373 100644 --- a/python/testSrc/com/jetbrains/python/inspections/Py3StringFormatInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/Py3StringFormatInspectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,6 +69,11 @@ public class Py3StringFormatInspectionTest extends PyTestCase { runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest); } + // PY-20599 + public void testPy3kAsciiFormatSpecifier() { + runWithLanguageLevel(LanguageLevel.PYTHON35, () -> doTest()); + } + private void doTest() { myFixture.configureByFile(TEST_DIRECTORY + getTestName(false) + ".py"); myFixture.enableInspections(PyStringFormatInspection.class); diff --git a/python/testSrc/com/jetbrains/python/inspections/PyStringFormatInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyStringFormatInspectionTest.java index b14a3df62414..0e39d546e832 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyStringFormatInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyStringFormatInspectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.jetbrains.python.inspections; import com.jetbrains.python.fixtures.PyTestCase; -import com.jetbrains.python.psi.LanguageLevel; /** * @author vlan @@ -193,11 +192,6 @@ public class PyStringFormatInspectionTest extends PyTestCase { public void testTooFewMappingKeys() { doTest(); } - - // PY-20599 - public void testPy3kAsciiFormatSpecifier() { - runWithLanguageLevel(LanguageLevel.PYTHON35, () -> doTest()); - } //PY-21166 public void testUnsupportedFormatSpecifierNewStyleFormatting() {