summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-10 18:41:07 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-11-12 18:00:31 +0100
commita26e3563975ca4656b87ba3679c720accb15f919 (patch)
tree69d0ada0ab1b91d98e51de75a1a3e66fd3fa5def
parenta4507960d147f3a04d51dd1bf3ce27a6692f419d (diff)
downloadpylint-git-a26e3563975ca4656b87ba3679c720accb15f919.tar.gz
Easier understanding of what happen for the expected result
-rw-r--r--pylint/testutils/configuration_test.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/pylint/testutils/configuration_test.py b/pylint/testutils/configuration_test.py
index 723e4afa3..d3d4550f6 100644
--- a/pylint/testutils/configuration_test.py
+++ b/pylint/testutils/configuration_test.py
@@ -4,6 +4,7 @@
"""Utility function for configuration testing."""
import copy
import json
+import logging
import unittest
from pathlib import Path
from typing import Any, Dict, Tuple, Union
@@ -24,6 +25,9 @@ def get_expected_or_default(pyproject_toml_path: str, suffix: str, default: Any)
if expected_result_path.exists():
with open(expected_result_path, encoding="utf8") as f:
expected = f.read()
+ logging.info("%s exists.", expected_result_path)
+ else:
+ logging.info("%s not found, using '%s'.", expected_result_path, default)
return expected
@@ -65,7 +69,14 @@ def get_expected_output(configuration_path: str) -> Tuple[int, str]:
return path.replace(USER_SPECIFIC, "")[1:]
output = get_expected_or_default(configuration_path, suffix="out", default="")
- exit_code = 2 if output else 0
+ if output:
+ logging.info(
+ "Output exists for %s so the expected exit code is 2", configuration_path
+ )
+ exit_code = 2
+ else:
+ logging.info(".out file does not exists, so the expected exit code is 0")
+ exit_code = 0
return exit_code, output.format(
abspath=configuration_path, relpath=get_relative_path(configuration_path)
)