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

authorClaudiu Popa <pcmanticore@gmail.com>
changeset2f302d631e3c
branchdefault
phasepublic
hiddenno
parent revision#303f137f3951 Remove import which was imported twice.
child revision#18da1f9006b2 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 2f302d631e3c950d29edd6f0d090a8df1ab979d6
# Parent 303f137f39511e25bd28f921dbabae2430593351
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])