hidden dependency in utility function (for tests?)
I am a bit confused by the following function defined in loadFiles.py
:
def compile_file_list(caosdbignore, localpath):
"""creates a list of files that contain all files under localpath except
those excluded by caosdbignore
"""
from gitignore_parser import parse_gitignore
matches = parse_gitignore(caosdbignore)
# (...)
It imports (upon calling) from an optional dependency gitignore_parser
, although the function is not contained in a test file.
Am I missing anything or should rather either:
- the function be contained in a test file or test module only?
- the gitignore_parser added as a real dependency and the import be located on top of the file?