summaryrefslogtreecommitdiff
path: root/test/test_functional.py
diff options
context:
space:
mode:
authorTorsten Marek <shlomme@gmail.com>2014-07-24 19:04:47 +0200
committerTorsten Marek <shlomme@gmail.com>2014-07-24 19:04:47 +0200
commitd76865583f0103915150ed901afeceba9f2eadba (patch)
tree13fdc313ec69358a16580f06b5e38d610ff65cb1 /test/test_functional.py
parent328c824b73debaeee050f39043ba78b0b512ecc5 (diff)
downloadpylint-d76865583f0103915150ed901afeceba9f2eadba.tar.gz
Make pylint compatible with Python 2.5 again, and make all the tests pass (Closes: #278).
Diffstat (limited to 'test/test_functional.py')
-rw-r--r--test/test_functional.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test_functional.py b/test/test_functional.py
index ae12360..5c5cafa 100644
--- a/test/test_functional.py
+++ b/test/test_functional.py
@@ -1,4 +1,5 @@
"""Functional full-module tests for PyLint."""
+from __future__ import with_statement
import ConfigParser
import cStringIO
import operator
@@ -88,15 +89,15 @@ class TestFile(object):
@property
def expected_output(self):
- return self._file_type('.txt')
+ return self._file_type('.txt', check_exists=False)
@property
def source(self):
return self._file_type('.py')
- def _file_type(self, ext):
+ def _file_type(self, ext, check_exists=True):
name = os.path.join(self._directory, self.base + ext)
- if os.path.exists(name):
+ if not check_exists or os.path.exists(name):
return name
else:
raise NoFileError
@@ -171,12 +172,12 @@ class LintModuleTest(testlib.TestCase):
self._linter = lint.PyLinter()
self._linter.set_reporter(test_reporter)
self._linter.config.persistent = 0
+ checkers.initialize(self._linter)
self._linter.disable('I')
try:
self._linter.load_file_configuration(test_file.option_file)
except NoFileError:
pass
- checkers.initialize(self._linter)
self._test_file = test_file
def shortDescription(self):