diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2014-04-14 12:59:18 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2014-04-14 12:59:18 +0200 |
commit | 61a8226c84e4c09c9e60b73514b21767f7dda13c (patch) | |
tree | fe0304e47b5699552094f58a0121f8f212d7492b /test/test_func.py | |
parent | b4db94d713c6301a471a89a9254ea157d5af9fcd (diff) | |
download | pylint-61a8226c84e4c09c9e60b73514b21767f7dda13c.tar.gz |
update test_func exhaustivity testing
* skip messages that can not be emitted
* use set instead of list
* properly mark max version to some messages and drop now (almost) useless
messages list
Diffstat (limited to 'test/test_func.py')
-rw-r--r-- | test/test_func.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/test/test_func.py b/test/test_func.py index 47862fc..63c585f 100644 --- a/test/test_func.py +++ b/test/test_func.py @@ -47,27 +47,18 @@ class TestTests(testlib.TestCase): @testlib.tag('coverage') def test_exhaustivity(self): # skip fatal messages - todo = [msg.msgid for msg in linter.messages if msg.msgid[0] != 'F'] + not_tested = set(msg.msgid for msg in linter.messages + if msg.msgid[0] != 'F' and msg.may_be_emitted()) for msgid in test_reporter.message_ids: try: - todo.remove(msgid) - except ValueError: + not_tested.remove(msgid) + except KeyError: continue - todo.sort() + not_tested -= set(('I0001',)) if PY3K: - rest = ['E1001', # slots-on-old-class - 'E1002', # super-on-old-class - # XXX : no use case for now : - 'I0001', - 'W0402', # deprecated module - 'W0403', # implicit relative import - 'W0410', # __future__ import not first statement - 'W0710', # nonstandard-exception - 'W1001' # property-on-old-class - ] - self.assertEqual(todo, rest) - else: - self.assertEqual(todo, ['I0001']) + not_tested.remove('W0403') # relative-import + self.assertFalse(not_tested) + class LintBuiltinModuleTest(LintTestUsingModule): output = join(MSG_DIR, 'builtin_module.txt') |