3
3
from abc import ABC
4
4
from pathlib import Path
5
5
from pprint import pprint
6
- from typing import Any , Dict , List
6
+ from typing import List , Type
7
7
8
8
import astroid
9
- from pylint .testutils import MessageTest , UnittestLinter
10
-
11
- try :
12
- from pylint .utils import ASTWalker
13
- except ImportError :
14
- # for pylint 1.9
15
- from pylint .utils import PyLintASTWalker as ASTWalker
16
-
17
9
from pylint .checkers import BaseChecker
10
+ from pylint .testutils import MessageTest , UnittestLinter
11
+ from pylint .utils import ASTWalker
18
12
19
13
import pylint_pytest .checkers .fixture
20
14
@@ -29,10 +23,9 @@ def get_test_root_path() -> Path:
29
23
30
24
class BasePytestTester (ABC ):
31
25
CHECKER_CLASS = BaseChecker
32
- IMPACTED_CHECKER_CLASSES : List [BaseChecker ] = []
26
+ IMPACTED_CHECKER_CLASSES : List [Type [ BaseChecker ] ] = []
33
27
MSG_ID : str
34
28
msgs : List [MessageTest ] = []
35
- CONFIG : Dict [str , Any ] = {}
36
29
37
30
def __init_subclass__ (cls , ** kwargs ):
38
31
super ().__init_subclass__ (** kwargs )
@@ -78,14 +71,10 @@ def setup_method(self):
78
71
self .checker = self .CHECKER_CLASS (self .linter )
79
72
self .impacted_checkers = []
80
73
81
- for key , value in self .CONFIG .items ():
82
- setattr (self .checker .config , key , value )
83
74
self .checker .open ()
84
75
85
76
for checker_class in self .IMPACTED_CHECKER_CLASSES :
86
77
checker = checker_class (self .linter )
87
- for key , value in self .CONFIG .items ():
88
- setattr (checker .config , key , value )
89
78
checker .open ()
90
79
self .impacted_checkers .append (checker )
91
80
0 commit comments