Skip to content

Commit

Permalink
Better explanation on why we use logging following review
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Nov 12, 2021
1 parent 2eaad65 commit da4c8fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pylint/testutils/configuration_test.py
Expand Up @@ -31,6 +31,9 @@ def get_path_according_to_suffix() -> Path:
if expected_result_path.exists():
with open(expected_result_path, encoding="utf8") as f:
expected = f.read()
# logging is helpful to to realize your file is not taken into
# account after a misspell of the file name. The output of the
# program is checked during the test so printing messes with the result.
logging.info("%s exists.", expected_result_path)
else:
logging.info("%s not found, using '%s'.", expected_result_path, default)
Expand Down Expand Up @@ -76,6 +79,9 @@ def get_relative_path(path: str) -> str:

output = get_expected_or_default(configuration_path, suffix="out", default="")
if output:
# logging is helpful to see what the expected exit code is and why.
# The output of the program is checked during the test so printing
# messes with the result.
logging.info(
"Output exists for %s so the expected exit code is 2", configuration_path
)
Expand Down
2 changes: 2 additions & 0 deletions tests/config/test_functional_config_loading.py
Expand Up @@ -67,6 +67,8 @@ def test_functional_config_loading(
caplog: LogCaptureFixture,
):
"""Functional tests for configurations."""
# logging is helpful to see what's expected and why. The output of the
# program is checked during the test so printing messes with the result.
caplog.set_level(logging.INFO)
configuration_path = str(FUNCTIONAL_DIR / configuration_path)
msg = f"Wrong result with configuration {configuration_path}"
Expand Down

0 comments on commit da4c8fe

Please sign in to comment.