summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-09 20:37:14 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-03-14 19:48:30 +0100
commitcd50f416aeb1f8b66f152bdbf941b7a149a5939c (patch)
treea12c018fa5cea69a76c983510faa63c1d8cb6868
parentd361b80acb0b4ba07c9586840847f8c3ac668568 (diff)
downloadpylint-git-cd50f416aeb1f8b66f152bdbf941b7a149a5939c.tar.gz
Migrate func_e12xx.py to new functional tests
-rw-r--r--tests/functional/s/string/string_log_formatting.py (renamed from tests/input/func_e12xx.py)12
-rw-r--r--tests/functional/s/string/string_log_formatting.txt6
-rw-r--r--tests/messages/func_e12xx.txt6
-rw-r--r--tests/test_func.py2
4 files changed, 13 insertions, 13 deletions
diff --git a/tests/input/func_e12xx.py b/tests/functional/s/string/string_log_formatting.py
index 74984d998..0aca73dbc 100644
--- a/tests/input/func_e12xx.py
+++ b/tests/functional/s/string/string_log_formatting.py
@@ -11,12 +11,12 @@ def pprint():
"""Test string format in logging statements.
"""
# These should all emit lint errors:
- logging.info(0, '') # 1205
- logging.info('', '') # 1205
- logging.info('%s%', '') # 1201
- logging.info('%s%s', '') # 1206
- logging.info('%s%y', '', '') # 1200
- logging.info('%s%s', '', '', '') # 1205
+ logging.info(0, '') # [logging-too-many-args]
+ logging.info('', '') # [logging-too-many-args]
+ logging.info('%s%', '') # [logging-format-truncated]
+ logging.info('%s%s', '') # [logging-too-few-args]
+ logging.info('%s%y', '', '') # [logging-unsupported-format]
+ logging.info('%s%s', '', '', '') # [logging-too-many-args]
# These should be okay:
logging.info(1)
diff --git a/tests/functional/s/string/string_log_formatting.txt b/tests/functional/s/string/string_log_formatting.txt
new file mode 100644
index 000000000..aec9c26d5
--- /dev/null
+++ b/tests/functional/s/string/string_log_formatting.txt
@@ -0,0 +1,6 @@
+logging-too-many-args:14:4:pprint:Too many arguments for logging format string
+logging-too-many-args:15:4:pprint:Too many arguments for logging format string
+logging-format-truncated:16:4:pprint:Logging format string ends in middle of conversion specifier
+logging-too-few-args:17:4:pprint:Not enough arguments for logging format string
+logging-unsupported-format:18:4:pprint:Unsupported logging format character 'y' (0x79) at index 3
+logging-too-many-args:19:4:pprint:Too many arguments for logging format string
diff --git a/tests/messages/func_e12xx.txt b/tests/messages/func_e12xx.txt
deleted file mode 100644
index 92640d256..000000000
--- a/tests/messages/func_e12xx.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-E: 14:pprint: Too many arguments for logging format string
-E: 15:pprint: Too many arguments for logging format string
-E: 16:pprint: Logging format string ends in middle of conversion specifier
-E: 17:pprint: Not enough arguments for logging format string
-E: 18:pprint: Unsupported logging format character 'y' (0x79) at index 3
-E: 19:pprint: Too many arguments for logging format string
diff --git a/tests/test_func.py b/tests/test_func.py
index 170055918..f96e53c28 100644
--- a/tests/test_func.py
+++ b/tests/test_func.py
@@ -120,7 +120,7 @@ def gen_tests(filter_rgx):
tests.append((module_file, messages_file, dependencies))
if UPDATE_FILE.exists():
return tests
- assert len(tests) < 28, "Please do not add new test cases here."
+ assert len(tests) < 19, "Please do not add new test cases here."
return tests