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 | 4322619b775d4ad7f9e6b75aedd61c59ead4ea37 (patch) | |
tree | 14968f3fc348a5f5b90007089dc01da12ec9acd5 /test | |
parent | 73b5aa30f8eb9efd9f2cabbe02e12e1ec8aa2180 (diff) | |
download | pylint-git-4322619b775d4ad7f9e6b75aedd61c59ead4ea37.tar.gz |
test_func: error message improvement
Diffstat (limited to 'test')
-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 078ff93d5..9765088c3 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]) |