From 15e5d938d5705f5d4b2a9e329cde90079251e6e7 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Mon, 31 Oct 2016 15:47:25 +0300 Subject: [PATCH] PY-21083 Fixed: Inspection of float.fromhex expecting incorrect arguments Fix skeleton for float.fromhex --- python/helpers/python-skeletons/__builtin__.py | 2 +- python/helpers/python-skeletons/builtins.py | 2 +- .../python/inspections/PyArgumentListInspectionTest.java | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/helpers/python-skeletons/__builtin__.py b/python/helpers/python-skeletons/__builtin__.py index 9d79c37be4c8..b592718b9ff1 100644 --- a/python/helpers/python-skeletons/__builtin__.py +++ b/python/helpers/python-skeletons/__builtin__.py @@ -1072,7 +1072,7 @@ class float(object): return 0.0 @staticmethod - def fromhex(cls, string): + def fromhex(string): """Create a floating-point number from a hexadecimal string. :type string: str diff --git a/python/helpers/python-skeletons/builtins.py b/python/helpers/python-skeletons/builtins.py index 73cd84c7eee7..be3537c5c79e 100644 --- a/python/helpers/python-skeletons/builtins.py +++ b/python/helpers/python-skeletons/builtins.py @@ -805,7 +805,7 @@ class float(object): return 0.0 @staticmethod - def fromhex(cls, string): + def fromhex(string): """Create a floating-point number from a hexadecimal string. :type string: str diff --git a/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java index 0f146dc20950..67a147fabb24 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java @@ -217,6 +217,11 @@ public class PyArgumentListInspectionTest extends PyTestCase { doMultiFileTest(); } + // PY-21083 + public void testFloatFromhex() { + doTest(); + } + private void doMultiFileTest() { final String folderPath = "inspections/PyArgumentListInspection/" + getTestName(false) + "/";