diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-16 15:06:20 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-16 15:06:20 +0100 |
commit | 1dffef2bf271d6156b87d03d2c16593f8206992b (patch) | |
tree | af0e1512068210ceeeed034be2eb9a079082091a /test/test_func.py | |
parent | b021150ec51fc4a4349793bb82bd2573ab497b40 (diff) | |
download | pylint-1dffef2bf271d6156b87d03d2c16593f8206992b.tar.gz |
test_func: error message improvement
Diffstat (limited to 'test/test_func.py')
-rw-r--r-- | test/test_func.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_func.py b/test/test_func.py index 078ff93..9765088 100644 --- a/test/test_func.py +++ b/test/test_func.py @@ -98,15 +98,16 @@ class LintTestUsingModule(testlib.TestCase): print ex ex.__str__ = exception_str raise - got = self.linter.reporter.finalize().strip() + got = self.linter.reporter.finalize() self.assertMultiLineEqual(got, self._get_expected()) + def _get_expected(self): if self.module.startswith('func_noerror_'): expected = '' else: output = open(self.output) - expected = output.read().strip() + expected = output.read().strip() + '\n' output.close() return expected @@ -157,12 +158,12 @@ class TestTests(testlib.TestCase): class LintTestNonExistentModuleTC(LintTestUsingModule): module = 'nonexistent' - _get_expected = lambda self: 'F: 1: No module named nonexistent' + _get_expected = lambda self: 'F: 1: No module named nonexistent\n' tags = testlib.Tags(('generated','pylint_input_%s' % module)) class LintTestNonExistentFileTC(LintTestUsingFile): module = join(INPUT_DIR, 'nonexistent.py') - _get_expected = lambda self: 'F: 1: No module named %s' % self.module[len(getcwd())+1 :] + _get_expected = lambda self: 'F: 1: No module named %s\n' % self.module[len(getcwd())+1 :] tags = testlib.Tags(('generated', 'pylint_input_%s' % module)) def test_functionality(self): self._test([self.module]) |