summaryrefslogtreecommitdiff
path: root/tests/functional/c
diff options
context:
space:
mode:
authorTim Martin <tim@asymptotic.co.uk>2021-10-06 20:56:32 +0100
committerGitHub <noreply@github.com>2021-10-06 21:56:32 +0200
commitf963868f6b46d31ef7ae1bd1196eafe50bc4bad7 (patch)
treebf03bfc20aa347f2ffa3266f816b2b4e8e51bdf7 /tests/functional/c
parent6ad9d6ce38988c55fa8d2c0cccfe03df8a08de54 (diff)
downloadpylint-git-f963868f6b46d31ef7ae1bd1196eafe50bc4bad7.tar.gz
Fix a crash if ``str.format`` is referenced without being called (#5109)
Closes #5058 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/functional/c')
-rw-r--r--tests/functional/c/consider/consider_using_f_string.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/functional/c/consider/consider_using_f_string.py b/tests/functional/c/consider/consider_using_f_string.py
index 1d5400d5a..f6801989e 100644
--- a/tests/functional/c/consider/consider_using_f_string.py
+++ b/tests/functional/c/consider/consider_using_f_string.py
@@ -116,3 +116,11 @@ def assignment_bad():
h = "String %s" % (PARAM_1) # [consider-using-f-string]
i = "String %s %s" % (PARAM_1, PARAM_2) # [consider-using-f-string]
j = "String %s" % (PARAM_LIST_SINGLE) # [consider-using-f-string]
+
+
+def regression_tests():
+ # Referencing .format in a kwarg should not be warned
+ def wrap_print(value):
+ print(value)
+
+ wrap_print(value="{}".format)