Skip to content

Commit

Permalink
Update pylint/testutils/configuration_test.py
Browse files Browse the repository at this point in the history
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
  • Loading branch information
Pierre-Sassoulas and DanielNoord committed Nov 12, 2021
1 parent bea964b commit 6b73b8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pylint/testutils/configuration_test.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6b73b8e

Please sign in to comment.