dirhash-python icon indicating copy to clipboard operation
dirhash-python copied to clipboard

Test failure with pathspec >= 0.10.0

Open cottsay opened this issue 3 years ago • 3 comments

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

cottsay avatar Nov 17 '22 21:11 cottsay

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)

andhus avatar Jan 15 '24 22:01 andhus

See also: https://github.com/cpburnz/python-pathspec/issues/62#issuecomment-1236501291

andhus avatar Apr 08 '24 20:04 andhus

proposed fix #25

frichtarik avatar Apr 10 '24 15:04 frichtarik