[ ] Finds files in subfolders if recursive is True
[ ] Filters filenames based on a pattern if one is supplied
[ ] Behaves the same whether you pass ".ext" or "ext" to suffix
[ ] Raises a NotADirectoryError if the supplied path isn't a directory
[ ] Raises a FileNotFoundError if a combination of input arguments doesn't return any files
The approach I've take so far is to generate the test data at runtime using pytest fixtures defined in a pytest conftest.py files. However, I don't think this is scalable, seeing as we need to create lots of different files to test various aspects of the module's functionality. It might be worth therefore looking at the pytest-datadir or pytest-cases plugins to see if there's a better way to generate and store our test data.
We need to test that _get_paths:
recursive
isTrue
pattern
if one is suppliedsuffix
NotADirectoryError
if the suppliedpath
isn't a directoryFileNotFoundError
if a combination of input arguments doesn't return any filesThe approach I've take so far is to generate the test data at runtime using pytest fixtures defined in a pytest conftest.py files. However, I don't think this is scalable, seeing as we need to create lots of different files to test various aspects of the module's functionality. It might be worth therefore looking at the pytest-datadir or pytest-cases plugins to see if there's a better way to generate and store our test data.
Resources: