From 6b73b8eeb02186b396b977cfb74edceec0c6a4a1 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Fri, 12 Nov 2021 08:18:26 +0100 Subject: [PATCH] Update pylint/testutils/configuration_test.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> --- pylint/testutils/configuration_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylint/testutils/configuration_test.py b/pylint/testutils/configuration_test.py index 01907332c5e..f861d4640a6 100644 --- a/pylint/testutils/configuration_test.py +++ b/pylint/testutils/configuration_test.py @@ -12,7 +12,7 @@ from pylint.lint import Run -USER_SPECIFIC = str(Path(__file__).parent.parent.parent) +USER_SPECIFIC_PATH = str(Path(__file__).parent.parent.parent) def get_expected_or_default(pyproject_toml_path: str, suffix: str, default: Any) -> str: @@ -66,7 +66,8 @@ def get_expected_output(configuration_path: str) -> Tuple[int, str]: def get_relative_path(path: str) -> str: """Get the relative path we want without the user specific path""" - return path.replace(USER_SPECIFIC, "")[1:] + # Second [1:] is to remove the closing '/' + return "".join(path.split(USER_SPECIFIC_PATH)[1:][1:]) output = get_expected_or_default(configuration_path, suffix="out", default="") if output: