Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 616249e

Browse files
authored
Merge pull request #1813 from pre-commit/fix_without_us_test
fix _path_without_us under test when path segment ends in slash
2 parents d7b189c + 87dccbb commit 616249e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/commands/install_uninstall_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ def _path_without_us():
259259
exe = find_executable('pre-commit', _environ=env)
260260
while exe:
261261
parts = env['PATH'].split(os.pathsep)
262-
after = [x for x in parts if x.lower() != os.path.dirname(exe).lower()]
262+
after = [
263+
x for x in parts
264+
if x.lower().rstrip(os.sep) != os.path.dirname(exe).lower()
265+
]
263266
if parts == after:
264267
raise AssertionError(exe, parts)
265268
env['PATH'] = os.pathsep.join(after)

0 commit comments

Comments
 (0)