summaryrefslogtreecommitdiff
path: root/testutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'testutils.py')
-rw-r--r--testutils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/testutils.py b/testutils.py
index 69ffde57c..8d8064dd7 100644
--- a/testutils.py
+++ b/testutils.py
@@ -30,6 +30,7 @@ from cStringIO import StringIO
from logilab.common import testlib
from pylint import checkers
+from pylint.utils import PyLintASTWalker
from pylint.reporters import BaseReporter
from pylint.interfaces import IReporter
from pylint.lint import PyLinter
@@ -201,6 +202,12 @@ class CheckerTestCase(testlib.TestCase):
'\n'.join(repr(m) for m in got)))
self.assertEqual(list(messages), got, msg)
+ def walk(self, node):
+ """recursive walk on the given node"""
+ walker = PyLintASTWalker(linter)
+ walker.add_checker(self.checker)
+ walker.walk(node)
+
# Init
test_reporter = TestReporter()