import pathlib
import shutil


def copy_test_files(dest, source=None):
    """ copy test images to temp directory, returns list of files copied """
    if source is None:
        source = pathlib.Path("tests/test_images")
    else:
        source = pathlib.Path(source)
    
    files_copied = []
    for source_file in source.glob("*"):
        dest_file = pathlib.Path(dest) / source_file.name
        shutil.copy2(str(source_file), str(dest_file))
        files_copied.append(dest_file)
    return files_copied