File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ """Perfect module with only documentation for configuration tests"""
Original file line number Diff line number Diff line change 7
7
import pylint .lint
8
8
from pylint .lint .run import Run
9
9
10
+ # We use an external file and not __file__ or pylint warning in this file
11
+ # makes the tests fails because the exit code changes
12
+ FILE_TO_LINT = str (Path (__file__ ).parent / "file_to_lint.py" )
13
+
14
+
10
15
def get_runner_from_config_file (
11
16
config_file : Union [str , Path ], expected_exit_code : int = 0
12
17
) -> Run :
13
18
"""Initialize pylint with the given configuration file and return the Run"""
14
- args = ["--rcfile" , str (config_file ), __file__ ]
19
+ args = ["--rcfile" , str (config_file ), FILE_TO_LINT ]
15
20
# If we used `pytest.raises(SystemExit)`, the `runner` variable
16
21
# would not be accessible outside the `with` block.
17
22
with unittest .mock .patch ("sys.exit" ) as mocked_exit :
You can’t perform that action at this time.
0 commit comments