def generate_example(tmpdir, depth=5):
    """
    Generate a directory structure containing a text file at the specified
    depth
    """
    dir = tmpdir.mkdir('test_dir')
    for i in range(depth):
        dir = dir.mkdir(f'test_dir{i}')

    p = dir.join('test_file.txt')
    p.write('Lorem Ipsum')
    return p