dirhash-python
dirhash-python copied to clipboard
Test failure with pathspec >= 0.10.0
The test_ignore_hidden_files test is broken when used with pathspec >= 0.10.0.
I'm not sure if this was a regression in that package or a bugfix.
self = <test_dirhash.TestGetIncludedPaths object at 0x7fad218e2c10>
def test_ignore_hidden_files(self):
self.mkdirs('root/d1')
self.mkdirs('root/.d2')
self.mkfile('root/f1')
self.mkfile('root/.f2')
self.mkfile('root/d1/f1')
self.mkfile('root/d1/.f2')
self.mkfile('root/.d2/f1')
# no ignore
filepaths = included_paths(self.path_to('root'))
assert filepaths == ['.d2/f1', '.f2', 'd1/.f2', 'd1/f1', 'f1']
# with ignore
filepaths = included_paths(
self.path_to('root'),
match=['*', '!.*']
)
> assert filepaths == ['.d2/f1', 'd1/f1', 'f1']
E AssertionError: assert ['d1/f1', 'f1'] == ['.d2/f1', 'd1/f1', 'f1']
E At index 0 diff: 'd1/f1' != '.d2/f1'
E Right contains one more item: 'f1'
E Use -v to get more diff
Thanks! Sorry for the huge delay -> https://github.com/andhus/dirhash-python/issues/9 Seems related to https://github.com/cpburnz/python-pathspec/issues/57 (?) Now also exposed here: https://github.com/andhus/dirhash-python/pull/17 (WIP)
See also: https://github.com/cpburnz/python-pathspec/issues/62#issuecomment-1236501291
proposed fix #25