Try to register the else-if checker explicitly instead on relying on path assumptions.

authorClaudiu Popa <pcmanticore@gmail.com>
changeset2089e0d2aa9d
branchdefault
phasepublic
hiddenno
parent revision#60faf8166d70 Remove import which was imported twice.
child revision#bb045a7ac647 Disable persistence for test_self.
files modified by this revision
pylint/test/extensions/test_elseif_used.py
# HG changeset patch
# User Claudiu Popa <pcmanticore@gmail.com>
# Date 1449067672 -7200
# Wed Dec 02 16:47:52 2015 +0200
# Node ID 2089e0d2aa9dd620376112081500248b1ec761d3
# Parent 60faf8166d7024288049d60d326c9ed262b6c1ef
Try to register the else-if checker explicitly instead on relying on path assumptions.

diff --git a/pylint/test/extensions/test_elseif_used.py b/pylint/test/extensions/test_elseif_used.py
@@ -4,13 +4,13 @@
1  import os
2  import os.path as osp
3  import unittest
4 
5  from pylint import checkers
6 +from pylint.extensions.check_elif import ElseifUsedChecker
7  from pylint.lint import PyLinter
8  from pylint.reporters import BaseReporter
9 -from pylint.utils import register_plugins
10 
11 
12  class TestReporter(BaseReporter):
13 
14      def handle_message(self, msg):
@@ -25,13 +25,11 @@
15      @classmethod
16      def setUpClass(cls):
17          cls._linter = PyLinter()
18          cls._linter.set_reporter(TestReporter())
19          checkers.initialize(cls._linter)
20 -        plugins_path = osp.join(osp.dirname(osp.abspath(__file__)), os.pardir,
21 -                                os.pardir, 'extensions')
22 -        register_plugins(cls._linter, plugins_path)
23 +        cls._linter.register_checker(ElseifUsedChecker(cls._linter))
24 
25      def test_elseif_message(self):
26          elif_test = osp.join(osp.dirname(osp.abspath(__file__)), 'data',
27                               'elif.py')
28          self._linter.check([elif_test])