mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
normalize slashes even earlier on windows for filenames
This commit is contained in:
parent
79359ed4e2
commit
5fb721f7a7
4 changed files with 30 additions and 15 deletions
|
|
@ -939,7 +939,7 @@ def test_classifier_normalizes_filenames_on_windows_to_forward_slashes(tmpdir):
|
|||
tmpdir.join('a/b/c').ensure()
|
||||
with mock.patch.object(os, 'altsep', '/'):
|
||||
with mock.patch.object(os, 'sep', '\\'):
|
||||
classifier = Classifier((r'a\b\c',))
|
||||
classifier = Classifier.from_config((r'a\b\c',), '', '^$')
|
||||
assert classifier.filenames == ['a/b/c']
|
||||
|
||||
|
||||
|
|
@ -947,7 +947,7 @@ def test_classifier_does_not_normalize_backslashes_non_windows(tmpdir):
|
|||
with mock.patch.object(os.path, 'lexists', return_value=True):
|
||||
with mock.patch.object(os, 'altsep', None):
|
||||
with mock.patch.object(os, 'sep', '/'):
|
||||
classifier = Classifier((r'a/b\c',))
|
||||
classifier = Classifier.from_config((r'a/b\c',), '', '^$')
|
||||
assert classifier.filenames == [r'a/b\c']
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue