diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-11 19:16:42 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-11-12 18:00:31 +0100 |
commit | a8e61d360e29984cd104efb8593e454c2913fce3 (patch) | |
tree | f48819a52614dcb94a3f67f1ecd3bdc9128d9af4 | |
parent | a26e3563975ca4656b87ba3679c720accb15f919 (diff) | |
download | pylint-git-a8e61d360e29984cd104efb8593e454c2913fce3.tar.gz |
Apply suggestions from code review
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
-rw-r--r-- | pylint/testutils/configuration_test.py | 8 | ||||
-rw-r--r-- | tests/config/test_functional_config_loading.py | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/pylint/testutils/configuration_test.py b/pylint/testutils/configuration_test.py index d3d4550f6..01907332c 100644 --- a/pylint/testutils/configuration_test.py +++ b/pylint/testutils/configuration_test.py @@ -1,7 +1,7 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -"""Utility function for configuration testing.""" +"""Utility functions for configuration testing.""" import copy import json import logging @@ -65,7 +65,7 @@ def get_expected_output(configuration_path: str) -> Tuple[int, str]: """Get the expected output of a functional test.""" def get_relative_path(path: str) -> str: - """Get the relative path we want without user specific information""" + """Get the relative path we want without the user specific path""" return path.replace(USER_SPECIFIC, "")[1:] output = get_expected_or_default(configuration_path, suffix="out", default="") @@ -88,10 +88,10 @@ def run_using_a_configuration_file( """Simulate a run with a configuration without really launching the checks.""" configuration_path = str(configuration_path) args = ["--rcfile", configuration_path, file_to_lint] - # If we used `pytest.raises(SystemExit)`, the `runner` variable + # We do not capture the `SystemExit` as then the `runner` variable # would not be accessible outside the `with` block. with unittest.mock.patch("sys.exit") as mocked_exit: - # Do not actually run checks, that could be slow. Do not mock + # Do not actually run checks, that could be slow. We don't mock # `Pylinter.check`: it calls `Pylinter.initialize` which is # needed to properly set up messages inclusion/exclusion # in `_msg_states`, used by `is_message_enabled`. diff --git a/tests/config/test_functional_config_loading.py b/tests/config/test_functional_config_loading.py index f83921438..25373195c 100644 --- a/tests/config/test_functional_config_loading.py +++ b/tests/config/test_functional_config_loading.py @@ -14,7 +14,7 @@ if this file exists. You must also define a ``regression_list_crash.result.json`` if you want to check the parsed configuration. This file will be loaded as a dict and will override the default value of the default pylint configuration. If you need to append or remove a value use the special key ``"functional_append"`` -and ``"functional_remove":``. Check the existing code for example. +and ``"functional_remove":``. Check the existing code for examples. """ # pylint: disable=redefined-outer-name @@ -34,9 +34,9 @@ from pylint.testutils.configuration_test import ( HERE = Path(__file__).parent FUNCTIONAL_DIR = HERE / "functional" -# We use string then recast to path so we can use -k in pytest otherwise -# we get 'configuration_path0' as a test name. Relative to the functional -# directory because otherwise the string is very lengthy +# We use string then recast to path so we can use -k in pytest. +# Otherwise we get 'configuration_path0' as a test name. The path is relative to the functional +# directory because otherwise the string would be very lengthy. CONFIGURATION_PATHS = [ str(path.relative_to(FUNCTIONAL_DIR)) for ext in ("toml", "ini", "cfg") |