Skip to content

Commit

Permalink
Merge pull request #1813 from pre-commit/fix_without_us_test
Browse files Browse the repository at this point in the history
fix _path_without_us under test when path segment ends in slash
  • Loading branch information
asottile committed Feb 24, 2021
2 parents d7b189c + 87dccbb commit 616249e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/commands/install_uninstall_test.py
Expand Up @@ -259,7 +259,10 @@ def _path_without_us():
exe = find_executable('pre-commit', _environ=env)
while exe:
parts = env['PATH'].split(os.pathsep)
after = [x for x in parts if x.lower() != os.path.dirname(exe).lower()]
after = [
x for x in parts
if x.lower().rstrip(os.sep) != os.path.dirname(exe).lower()
]
if parts == after:
raise AssertionError(exe, parts)
env['PATH'] = os.pathsep.join(after)
Expand Down

0 comments on commit 616249e

Please sign in to comment.