def dir_root_dir(tmpdir_factory):
    """Prepares the testing dirs for dir tests"""
    root_dir = tmpdir_factory.mktemp('complex_dir')

    for dir_path in ['dir0/1.file',
                     'arg/name/dir1/1.file',
                     'vars/arg/name/dir2/1.file',
                     'defaults/arg/name/dir3/1.file']:
        # creating a file will create a dir
        root_dir.join(dir_path).ensure()

    return root_dir