[FIX] check _exclude_directories in relative_path to avoid to fail when testing. test is done in a 'tests' folder, that is a excluded directory

This commit is contained in:
Sylvain LE GAL 2022-06-16 22:13:41 +02:00
parent 0da6590d6f
commit 8699d4e8b6

View File

@ -494,7 +494,8 @@ class OdooModuleVersion(object):
for root, dirs, files in os.walk(
self.addon_path / Path(self.odoo_module.name), followlinks=True
):
if set(Path(root).parts) & set(self._exclude_directories):
relative_path = os.path.relpath(Path(root), self.addon_path)
if set(Path(relative_path).parts) & set(self._exclude_directories):
continue
for name in files:
if name in self._exclude_files: