Skip to content

Commit 6f896b9

Browse files
[doc tests] Print the launched command line for easier debug (#6867)
1 parent 34c6aed commit 6f896b9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

doc/test_messages_documentation.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,21 @@ def __init__(self, test_file: Tuple[str, Path]) -> None:
8181
# Check if this message has a custom configuration file (e.g. for enabling optional checkers).
8282
# If not, use the default configuration.
8383
config_file: Optional[Path]
84-
if (test_file[1].parent / "pylintrc").exists():
85-
config_file = test_file[1].parent / "pylintrc"
84+
msgid, full_path = test_file
85+
pylintrc = full_path.parent / "pylintrc"
86+
if pylintrc.exists():
87+
config_file = pylintrc
8688
else:
8789
config_file = next(config.find_default_config_files(), None)
88-
90+
args = [
91+
str(full_path),
92+
"--disable=all",
93+
f"--enable={msgid},astroid-error,fatal,syntax-error",
94+
]
95+
print(f"Command used:\npylint {' '.join(args)}")
8996
_config_initialization(
9097
self._linter,
91-
args_list=[
92-
str(test_file[1]),
93-
"--disable=all",
94-
f"--enable={test_file[0]},astroid-error,fatal,syntax-error",
95-
],
98+
args_list=args,
9699
reporter=_test_reporter,
97100
config_file=config_file,
98101
)

0 commit comments

Comments
 (0)