diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2007-02-22 10:57:19 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2007-02-22 10:57:19 +0100 |
commit | 9ab00128a56fd4cbb7d3fe5257344e0fd043f7e1 (patch) | |
tree | 16fa5d426ed545052213543916daf0a4d89ebfd1 | |
parent | 262e2fd292d381457775615b8fab2ad165a9fd98 (diff) | |
download | pylint-git-9ab00128a56fd4cbb7d3fe5257344e0fd043f7e1.tar.gz |
new generic F0004 message for unexpected inference
-rw-r--r-- | lint.py | 3 | ||||
-rw-r--r-- | test/func_test.py | 19 |
2 files changed, 14 insertions, 8 deletions
@@ -82,6 +82,9 @@ MSGS = { 'F0003': ('ignored builtin module %s', 'Used to indicate that the user asked to analyze a builtin module\ which has been skipped.'), + 'F0004': ('unexpected infered value %s', + 'Used to indicate that some value of an unexpected type has been \ + infered.'), 'I0001': ('Unable to run raw checkers on built-in module %s', 'Used to inform that a built-in module has not been checked \ diff --git a/test/func_test.py b/test/func_test.py index f1c33d9cc..b8357c336 100644 --- a/test/func_test.py +++ b/test/func_test.py @@ -1,4 +1,4 @@ -# Copyright (c) 2003-2006 LOGILAB S.A. (Paris, FRANCE). +# Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program is free software; you can redistribute it and/or modify it under @@ -106,17 +106,20 @@ class LintTestUsingFile(LintTestUsingModule): class TestTests(unittest.TestCase): """check that all testable messages have been checked""" def test(self): - # skip rpython checker messages - todo = [msgid for msgid in linter._messages.keys() if msgid[1:3] != '12'] - for msg_id in test_reporter.message_ids.keys(): - todo.remove(msg_id) + # skip rpython checker and fatal messages + todo = [msgid for msgid in linter._messages.keys() if msgid[1:3] != '12' and msgid[0] != 'F'] + for msgid in test_reporter.message_ids.keys(): + try: + todo.remove(msgid) + except ValueError: + continue todo.sort() if PY25: - self.assertEqual(todo, ['E0503', 'E1010', 'F0002', 'F0202', 'F0321', 'I0001']) + self.assertEqual(todo, ['E0503', 'E1010', 'I0001']) elif PY23: - self.assertEqual(todo, ['E0503', 'F0002', 'F0202', 'F0321', 'I0001']) + self.assertEqual(todo, ['E0503', 'I0001']) else: # python < 2.3 - self.assertEqual(todo, ['F0002', 'F0202', 'F0321', 'I0001']) + self.assertEqual(todo, ['I0001']) #bycat = {} #for msgid in linter._messages.keys(): |