summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2011-07-08 10:22:28 +0200
committerSylvain Thénault <sylvain.thenault@logilab.fr>2011-07-08 10:22:28 +0200
commit9894a90d4389a80e2a2921298f972e42303b642c (patch)
tree3428b4ff15baf5f19c17f3b10700c6981acac57b
parent1fa5b2d8202ce2cf899016d37992aba61ee28df7 (diff)
downloadpylint-git-9894a90d4389a80e2a2921298f972e42303b642c.tar.gz
missing test data files
-rw-r--r--test/input/func_e65xx.py27
-rw-r--r--test/messages/func_e65xx.txt6
2 files changed, 33 insertions, 0 deletions
diff --git a/test/input/func_e65xx.py b/test/input/func_e65xx.py
new file mode 100644
index 000000000..854c34796
--- /dev/null
+++ b/test/input/func_e65xx.py
@@ -0,0 +1,27 @@
+# pylint: disable=E1101
+"""Test checking of log format strings
+"""
+
+__revision__ = ''
+
+import logging
+
+def pprint():
+ """Test string format in logging statements.
+ """
+ # These should all emit lint errors:
+ logging.info(0, '') # 6505
+ logging.info('', '') # 6505
+ logging.info('%s%', '') # 6501
+ logging.info('%s%s', '') # 6506
+ logging.info('%s%a', '', '') # 6500
+ logging.info('%s%s', '', '', '') # 6505
+
+ # These should be okay:
+ logging.info(1)
+ logging.info(True)
+ logging.info('')
+ logging.info('%s%')
+ logging.info('%s', '')
+ logging.info('%s%%', '')
+ logging.info('%s%s', '', '')
diff --git a/test/messages/func_e65xx.txt b/test/messages/func_e65xx.txt
new file mode 100644
index 000000000..690e6f405
--- /dev/null
+++ b/test/messages/func_e65xx.txt
@@ -0,0 +1,6 @@
+E: 13:pprint: Too many arguments for logging format string
+E: 14:pprint: Too many arguments for logging format string
+E: 15:pprint: Logging format string ends in middle of conversion specifier
+E: 16:pprint: Not enough arguments for logging format string
+E: 17:pprint: Unsupported logging format character 'a' (0x61) at index 3
+E: 18:pprint: Too many arguments for logging format string